| | |
| | | const backupFile = path.join(replacePath, config[key]); |
| | | const replaceFile = path.join(resourcePath, companyMap[key]); |
| | | |
| | | await copyFileWithOverwrite(originFile, backupFile); |
| | | if (fsSync.existsSync(originFile)) { |
| | | await copyFileWithOverwrite(originFile, backupFile); |
| | | } |
| | | await copyFileWithOverwrite(replaceFile, originFile); |
| | | } |
| | | |
| | |
| | | |
| | | const originFile = path.join(rootPath, config[key]); |
| | | const backupFile = path.join(replacePath, config[key]); |
| | | await copyFileWithOverwrite(backupFile, originFile); |
| | | if (fsSync.existsSync(backupFile)) { |
| | | await copyFileWithOverwrite(backupFile, originFile); |
| | | } |
| | | } |
| | | await fs.rm(replacePath, { recursive: true, force: true }); |
| | | console.log(`🗑️ 已删除 ${replacePath}`); |