|
@@ -3,6 +3,7 @@ const fs = require('fs');
|
|
const path = require('path');
|
|
const path = require('path');
|
|
const { execSync } = require('child_process');
|
|
const { execSync } = require('child_process');
|
|
const { rmSync } = require('fs');
|
|
const { rmSync } = require('fs');
|
|
|
|
+const { exec } = require('cordova');
|
|
|
|
|
|
// 计算各路径
|
|
// 计算各路径
|
|
const rootDir = path.join(__dirname, '..'); // 项目根目录
|
|
const rootDir = path.join(__dirname, '..'); // 项目根目录
|
|
@@ -11,6 +12,9 @@ const srcDir = path.join(rootDir, 'dist', 'h5'); // ../dist/h5
|
|
const dstDir = path.join(cordovaPrjDir, 'www');
|
|
const dstDir = path.join(cordovaPrjDir, 'www');
|
|
|
|
|
|
rmSync('.build/dros', { recursive: true, force: true });
|
|
rmSync('.build/dros', { recursive: true, force: true });
|
|
|
|
+// 做一些环境检查
|
|
|
|
+execSync('npx cordova --version', { stdio: 'inherit' });
|
|
|
|
+execSync('npx cordova requirements', { stdio: 'inherit' });
|
|
// 1. 在项目根目录执行 cordova create
|
|
// 1. 在项目根目录执行 cordova create
|
|
execSync('npx cordova create .build/dros zskk.dros dros', { cwd: rootDir, stdio: 'inherit' });
|
|
execSync('npx cordova create .build/dros zskk.dros dros', { cwd: rootDir, stdio: 'inherit' });
|
|
|
|
|