fix hashing utility changing cwd

pull/310/head
Frostebite 2022-01-25 00:07:13 +00:00
parent e077b50e2b
commit b7ffbf143c
3 changed files with 11 additions and 5 deletions

7
dist/index.js vendored
View File

@ -755,10 +755,13 @@ class LFSHashing {
} }
static hashAllFiles(folder) { static hashAllFiles(folder) {
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {
process.chdir(`${folder}`); const startPath = process.cwd();
return yield (yield cloud_runner_system_1.CloudRunnerSystem.Run(`find -type f -exec md5sum "{}" + | sort | md5sum`)) process.chdir(folder);
const result = yield (yield cloud_runner_system_1.CloudRunnerSystem.Run(`find -type f -exec md5sum "{}" + | sort | md5sum`))
.replace(/\n/g, '') .replace(/\n/g, '')
.split(` `)[0]; .split(` `)[0];
process.chdir(startPath);
return result;
}); });
} }
} }

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

View File

@ -31,9 +31,12 @@ export class LFSHashing {
} }
} }
public static async hashAllFiles(folder: string) { public static async hashAllFiles(folder: string) {
process.chdir(`${folder}`); const startPath = process.cwd();
return await (await CloudRunnerSystem.Run(`find -type f -exec md5sum "{}" + | sort | md5sum`)) process.chdir(folder);
const result = await (await CloudRunnerSystem.Run(`find -type f -exec md5sum "{}" + | sort | md5sum`))
.replace(/\n/g, '') .replace(/\n/g, '')
.split(` `)[0]; .split(` `)[0];
process.chdir(startPath);
return result;
} }
} }