File tree 1 file changed +9
-4
lines changed
1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ const AgentCommands = {
12
12
npm : "npm i" ,
13
13
yarn : "yarn add" ,
14
14
pnpm : "pnpm add" ,
15
- cnpm : "cnpm i"
15
+ cnpm : "cnpm i" ,
16
16
} ;
17
17
18
18
function loadModule ( name ) {
@@ -28,7 +28,7 @@ function installModules(names) {
28
28
names = Array . isArray ( names ) ? names : [ names ] ;
29
29
execSync ( `${ command } ${ names . join ( " " ) } ` , {
30
30
stdio : "inherit" ,
31
- cwd : userRoot
31
+ cwd : userRoot ,
32
32
} ) ;
33
33
}
34
34
@@ -52,8 +52,13 @@ function switchVersion(version) {
52
52
}
53
53
const files = fs . readdirSync ( versionPath ) ;
54
54
55
- files . forEach ( f => {
56
- fs . copyFileSync ( path . join ( versionPath , f ) , path . join ( dist , f ) ) ;
55
+ files . forEach ( ( f ) => {
56
+ const dfile = path . join ( dist , f ) ;
57
+ try {
58
+ // pnpm fix
59
+ fs . unlinkSync ( dfile ) ;
60
+ } catch ( _ ) { }
61
+ fs . copyFileSync ( path . join ( versionPath , f ) , dfile ) ;
57
62
} ) ;
58
63
59
64
switchPeerdependencies ( version ) ;
You can’t perform that action at this time.
0 commit comments