|
@@ -18,10 +18,15 @@ console.log(`获取当前的配置文件...`)
|
|
const indexJsonPath = path.join(currentDirectory, 'src/config/index.json');
|
|
const indexJsonPath = path.join(currentDirectory, 'src/config/index.json');
|
|
const indexJsonContent = fs.readFileSync(indexJsonPath, 'utf8');
|
|
const indexJsonContent = fs.readFileSync(indexJsonPath, 'utf8');
|
|
|
|
|
|
-//创建缓存文件
|
|
|
|
-console.log(`创建配置缓存文件...`)
|
|
|
|
-const cacheJsonPath = path.join(currentDirectory, 'scripts/cache.json');
|
|
|
|
-fs.writeFileSync(cacheJsonPath, indexJsonContent, 'utf8');
|
|
|
|
|
|
+// 检测上次打包异常中断的缓存文件是否存在
|
|
|
|
+console.log(`检测上次打包异常中断的缓存文件是否存在...`)
|
|
|
|
+const cacheFilePath = path.join(currentDirectory, 'scripts/cache.json');
|
|
|
|
+if(!fs.existsSync(cacheFilePath)) {
|
|
|
|
+ //创建缓存文件
|
|
|
|
+ console.log(`创建配置缓存文件...`)
|
|
|
|
+ const cacheJsonPath = path.join(currentDirectory, 'scripts/cache.json');
|
|
|
|
+ fs.writeFileSync(cacheJsonPath, indexJsonContent, 'utf8');
|
|
|
|
+}
|
|
|
|
|
|
//修改配置文件
|
|
//修改配置文件
|
|
const indexJson = JSON.parse(indexJsonContent);
|
|
const indexJson = JSON.parse(indexJsonContent);
|