@@ -56,6 +56,9 @@ async function dev() {
56
56
return
57
57
}
58
58
59
+ console . log ( cyan ( 'Fetching origin...' ) )
60
+ spawn ( 'git' , [ 'pull' ] , { stdio : 'inherit' } )
61
+
59
62
console . log ( cyan ( `Switching to Vue ${ targetVersion } ...` ) )
60
63
const mod = await loadFile ( './vite.config.ts' )
61
64
@@ -101,7 +104,7 @@ async function dev() {
101
104
}
102
105
103
106
await writeFile ( mod as unknown as ASTNode , './vite.config.ts' )
104
- spawn . sync ( 'npx' , [ 'eslint' , './vite.config.ts' , '--fix' ] , { stdio : 'inherit' } )
107
+ spawn ( 'npx' , [ 'eslint' , './vite.config.ts' , '--fix' ] , { stdio : 'inherit' } )
105
108
106
109
let isDepsChanged = false
107
110
@@ -131,7 +134,7 @@ async function dev() {
131
134
if ( isDepsChanged ) {
132
135
fs . writeFileSync ( './package.json' , JSON . stringify ( pkg , null , 2 ) )
133
136
console . log ( cyan ( 'Linting package.json...' ) )
134
- spawn . sync ( 'npx' , [ 'eslint' , './package.json' , '--fix' ] , { stdio : 'inherit' } )
137
+ spawn ( 'npx' , [ 'eslint' , './package.json' , '--fix' ] , { stdio : 'inherit' } )
135
138
await installDependencies ( )
136
139
}
137
140
@@ -174,14 +177,14 @@ async function dev() {
174
177
console . log ( cyan ( 'Installing node lts...' ) )
175
178
spawn . sync ( 'pnpm' , [ 'env' , 'use' , '-g' , 'lts' ] , { stdio : 'inherit' } )
176
179
console . log ( cyan ( 'Installing global packages...' ) )
177
- spawn . sync ( 'pnpm' , [ 'add' , 'cnpm' , '@antfu/ni' , 'only-allow' , '-g' ] , { stdio : 'inherit' } )
180
+ spawn ( 'pnpm' , [ 'add' , 'cnpm' , '@antfu/ni' , 'only-allow' , '-g' ] , { stdio : 'inherit' } )
178
181
} catch ( e ) {
179
182
180
183
}
181
184
}
182
185
}
183
- console . log ( cyan ( 'Upgrading dependencies...' ) )
184
- spawn . sync ( 'pnpm' , [ 'up ' ] , { stdio : 'inherit' } )
186
+ console . log ( cyan ( 'Installing dependencies...' ) )
187
+ spawn . sync ( 'pnpm' , [ 'i ' ] , { stdio : 'inherit' } )
185
188
spawn . sync ( 'npx' , [ 'vue-demi-switch' , targetVersion === '2.6' ? '2' : targetVersion ] , { stdio : 'inherit' } )
186
189
}
187
190
}
0 commit comments