File tree Expand file tree Collapse file tree
packages/gpts-zip/scripts Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -17,7 +17,13 @@ await $`cp -r ../hikkaku/dist .tmp/node_modules/hikkaku`
1717const NECESSARY_PACKAGES = [ 'sb3-types' , '@typescript' , '@types/node' ]
1818await $ `mkdir -p .tmp/node_modules/@types`
1919for ( const pkg of NECESSARY_PACKAGES ) {
20- await $ `cp -r ./node_modules/${ pkg } .tmp/node_modules/${ pkg } `
20+ if ( existsSync ( `//node_modules/${ pkg } ` ) ) {
21+ await $ `cp -r ./node_modules/${ pkg } .tmp/node_modules/${ pkg } `
22+ } else if ( existsSync ( `../../node_modules/${ pkg } ` ) ) {
23+ await $ `cp -r ../../node_modules/${ pkg } .tmp/node_modules/${ pkg } `
24+ } else {
25+ console . warn ( `Package ${ pkg } not found in node_modules` )
26+ }
2127}
2228
2329// ファイルを置く
@@ -93,7 +99,7 @@ await Bun.write(
9399 } ) ,
94100)
95101
96- import { readdirSync , readFileSync } from 'node:fs'
102+ import { existsSync , readdirSync , readFileSync } from 'node:fs'
97103// .tmp を zip にする
98104import { zipSync } from 'fflate'
99105
You can’t perform that action at this time.
0 commit comments