move results directory then rename

pull/310/head
Frostebite 2022-01-24 21:31:54 +00:00
parent a2ab870e8f
commit c2b658a8d3
3 changed files with 7 additions and 5 deletions

5
dist/index.js vendored
View File

@ -603,8 +603,9 @@ class Caching {
yield cloud_runner_system_1.CloudRunnerSystem.Run(`unzip ${cacheSelection}.zip -d ${path_1.default.basename(resultsDirectory)}`); yield cloud_runner_system_1.CloudRunnerSystem.Run(`unzip ${cacheSelection}.zip -d ${path_1.default.basename(resultsDirectory)}`);
remote_client_logger_1.RemoteClientLogger.log(`cache item extracted to ${fullDestination}`); remote_client_logger_1.RemoteClientLogger.log(`cache item extracted to ${fullDestination}`);
console_1.assert(`${fs_1.default.existsSync(fullDestination)}`); console_1.assert(`${fs_1.default.existsSync(fullDestination)}`);
yield cloud_runner_system_1.CloudRunnerSystem.Run(`mv "${fullDestination}/*" "${destinationFolder}"`); yield cloud_runner_system_1.CloudRunnerSystem.Run(`mv "${fullDestination}" "${destinationFolder}/.."`);
fs_1.default.rmdirSync(fullDestination); fs_1.default.rmdirSync(destinationFolder);
fs_1.default.renameSync(`${destinationFolder}/../${resultsDirectory}`, destinationFolder);
} }
else { else {
remote_client_logger_1.RemoteClientLogger.logWarning(`cache item ${cacheKey} doesn't exist ${destinationFolder}`); remote_client_logger_1.RemoteClientLogger.logWarning(`cache item ${cacheKey} doesn't exist ${destinationFolder}`);

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

View File

@ -77,8 +77,9 @@ export class Caching {
await CloudRunnerSystem.Run(`unzip ${cacheSelection}.zip -d ${path.basename(resultsDirectory)}`); await CloudRunnerSystem.Run(`unzip ${cacheSelection}.zip -d ${path.basename(resultsDirectory)}`);
RemoteClientLogger.log(`cache item extracted to ${fullDestination}`); RemoteClientLogger.log(`cache item extracted to ${fullDestination}`);
assert(`${fs.existsSync(fullDestination)}`); assert(`${fs.existsSync(fullDestination)}`);
await CloudRunnerSystem.Run(`mv "${fullDestination}/*" "${destinationFolder}"`); await CloudRunnerSystem.Run(`mv "${fullDestination}" "${destinationFolder}/.."`);
fs.rmdirSync(fullDestination); fs.rmdirSync(destinationFolder);
fs.renameSync(`${destinationFolder}/../${resultsDirectory}`, destinationFolder);
} else { } else {
RemoteClientLogger.logWarning(`cache item ${cacheKey} doesn't exist ${destinationFolder}`); RemoteClientLogger.logWarning(`cache item ${cacheKey} doesn't exist ${destinationFolder}`);
if (cacheSelection !== ``) { if (cacheSelection !== ``) {