File tree Expand file tree Collapse file tree 2 files changed +27
-1
lines changed
Expand file tree Collapse file tree 2 files changed +27
-1
lines changed Original file line number Diff line number Diff line change 99 "clean" : " sh scripts/gradlew-link clean" ,
1010 "plugin" : " sh utils/scripts/plugin.sh" ,
1111 "setup" : " npx cap sync" ,
12- "sync" : " npx cap sync && node scripts/postSync .js" ,
12+ "sync" : " node scripts/preSync .js" ,
1313 "lint" : " biome lint --write" ,
1414 "format" : " biome format --write" ,
1515 "check" : " biome check --write" ,
Original file line number Diff line number Diff line change 1+ const readline = require ( 'readline' ) ;
2+ const path = require ( 'path' ) ;
3+ const { execSync } = require ( "child_process" ) ;
4+
5+ const rl = readline . createInterface ( {
6+ input : process . stdin ,
7+ output : process . stdout
8+ } ) ;
9+
10+
11+
12+ console . log ( '\x1b[33m⚠️ WARNING:\x1b[0m The Android directory will be rebuilt.' ) ;
13+ console . log ( '\x1b[33mSome configuration files or other changes may be lost.\x1b[0m' ) ;
14+ console . log ( '\x1b[33mThis is usually not necessary and may break the build or cause build issues.\x1b[0m' ) ;
15+
16+ rl . question ( 'Do you want to continue? (y/n): ' , ( answer ) => {
17+ const normalized = answer . trim ( ) . toLowerCase ( ) ;
18+ if ( normalized === 'y' ) {
19+ console . log ( '\n🔁 Syncing with Capacitor...' ) ;
20+ rl . close ( ) ;
21+ execSync ( "npx cap sync && node \"$(npm prefix)/scripts/postSync.js\"" , { stdio : "inherit" } ) ;
22+ } else {
23+ console . log ( '\n🚫 Operation cancelled.' ) ;
24+ rl . close ( ) ;
25+ }
26+ } ) ;
You can’t perform that action at this time.
0 commit comments