mirror of
https://github.com/openharmony/developtools_ace-ets2bundle.git
synced 2026-07-21 03:55:23 -04:00
+14
-15
@@ -382,32 +382,31 @@ function loadModuleInfo(projectConfig, envArgs) {
|
||||
|
||||
function checkAppResourcePath(appResourcePath, config) {
|
||||
if (appResourcePath) {
|
||||
const appResourcePathSavePath = path.resolve(projectConfig.cachePath, 'resource_path.txt');
|
||||
saveAppResourcePath(appResourcePath, appResourcePathSavePath);
|
||||
readAppResource(resources, appResourcePath);
|
||||
if (fs.existsSync(appResourcePath) && config.cache) {
|
||||
config.cache.buildDependencies.config.push(appResourcePath);
|
||||
}
|
||||
if (fs.existsSync(appResourcePathSavePath) && config.cache) {
|
||||
config.cache.buildDependencies.config.push(appResourcePathSavePath);
|
||||
if (!projectConfig.xtsMode) {
|
||||
saveAppResourcePath(appResourcePath, appResourcePathSavePath);
|
||||
if (fs.existsSync(appResourcePathSavePath) && config.cache) {
|
||||
config.cache.buildDependencies.config.push(appResourcePathSavePath);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function saveAppResourcePath(appResourcePath, appResourcePathSavePath) {
|
||||
if (!projectConfig.xtsMode) {
|
||||
let isSave = false;
|
||||
if (fs.existsSync(appResourcePathSavePath)) {
|
||||
const saveContent = fs.readFileSync(appResourcePathSavePath);
|
||||
if (appResourcePath !== saveContent) {
|
||||
isSave = true;
|
||||
}
|
||||
} else {
|
||||
let isSave = false;
|
||||
if (fs.existsSync(appResourcePathSavePath)) {
|
||||
const saveContent = fs.readFileSync(appResourcePathSavePath);
|
||||
if (appResourcePath !== saveContent) {
|
||||
isSave = true;
|
||||
}
|
||||
if (isSave) {
|
||||
fs.writeFileSync(appResourcePathSavePath, appResourcePath);
|
||||
}
|
||||
} else {
|
||||
isSave = true;
|
||||
}
|
||||
if (isSave) {
|
||||
fs.writeFileSync(appResourcePathSavePath, appResourcePath);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user