@@ -45,30 +45,38 @@ if (fs.existsSync(builtinDirectory)) {
45
45
}
46
46
47
47
// install external modules into dist folder
48
- cproc . exec ( 'pnpm add [email protected] ' , { cwd :
'./dist' } , ( error , stdout , stderr ) => {
48
+ cproc . exec ( 'pnpm init ' , { cwd : './dist' } , ( error , stdout , stderr ) => {
49
49
if ( error ) {
50
50
console . log ( stdout ) ;
51
51
console . log ( stderr ) ;
52
52
throw error ;
53
53
}
54
54
55
- byline ( fileStream )
56
- . on ( 'data' , line => {
57
- line . startsWith ( '!' ) ? excludedFiles . push ( line . substring ( 1 ) ) : includedFiles . push ( line ) ;
58
- } )
59
- . on ( 'error' , ( ) => {
60
- throw new Error ( 'Error reading .extfiles' ) ;
61
- } )
62
- . on ( 'end' , ( ) => {
63
- includedFiles . push ( zipDirectory ) ; // add destination dir
64
- mkdirp . sync ( zipDirectory ) ;
65
- console . log ( `Copying files to ${ zipDirectory } ` ) ;
66
- cp ( includedFiles , { exclude : excludedFiles } , error => {
67
- if ( error ) {
68
- throw new Error ( 'Error copying files' , error ) ;
69
- }
70
- console . log ( `Zipping files to ${ destFile } ` ) ;
71
- zipper . sync . zip ( zipDirectory ) . compress ( ) . save ( destFile ) ;
55
+ cproc . exec ( 'pnpm install [email protected] ' , { cwd :
'./dist' } , ( error , stdout , stderr ) => {
56
+ if ( error ) {
57
+ console . log ( stdout ) ;
58
+ console . log ( stderr ) ;
59
+ throw error ;
60
+ }
61
+
62
+ byline ( fileStream )
63
+ . on ( 'data' , line => {
64
+ line . startsWith ( '!' ) ? excludedFiles . push ( line . substring ( 1 ) ) : includedFiles . push ( line ) ;
65
+ } )
66
+ . on ( 'error' , ( ) => {
67
+ throw new Error ( 'Error reading .extfiles' ) ;
68
+ } )
69
+ . on ( 'end' , ( ) => {
70
+ includedFiles . push ( zipDirectory ) ; // add destination dir
71
+ mkdirp . sync ( zipDirectory ) ;
72
+ console . log ( `Copying files to ${ zipDirectory } ` ) ;
73
+ cp ( includedFiles , { exclude : excludedFiles } , error => {
74
+ if ( error ) {
75
+ throw new Error ( 'Error copying files' , error ) ;
76
+ }
77
+ console . log ( `Zipping files to ${ destFile } ` ) ;
78
+ zipper . sync . zip ( zipDirectory ) . compress ( ) . save ( destFile ) ;
79
+ } ) ;
72
80
} ) ;
73
- } ) ;
81
+ } ) ;
74
82
} ) ;
0 commit comments