pull/524/head
Frostebite 2023-03-11 14:30:01 +00:00
parent 512cd41881
commit 2973cc643f
3 changed files with 24 additions and 15 deletions

19
dist/index.js generated vendored
View File

@ -4276,15 +4276,20 @@ class RemoteClient {
static async runCustomHookFiles(hookLifecycle) { static async runCustomHookFiles(hookLifecycle) {
remote_client_logger_1.RemoteClientLogger.log(`RunCustomHookFiles: ${hookLifecycle}`); remote_client_logger_1.RemoteClientLogger.log(`RunCustomHookFiles: ${hookLifecycle}`);
const gameCiCustomHooksPath = node_path_1.default.join(cloud_runner_folders_1.CloudRunnerFolders.repoPathAbsolute, `game-ci`, `hooks`); const gameCiCustomHooksPath = node_path_1.default.join(cloud_runner_folders_1.CloudRunnerFolders.repoPathAbsolute, `game-ci`, `hooks`);
const files = node_fs_1.default.readdirSync(gameCiCustomHooksPath); try {
for (const file of files) { const files = node_fs_1.default.readdirSync(gameCiCustomHooksPath);
const fileContents = node_fs_1.default.readFileSync(node_path_1.default.join(gameCiCustomHooksPath, file), `utf8`); for (const file of files) {
const fileContentsObject = yaml_1.default.parse(fileContents.toString()); const fileContents = node_fs_1.default.readFileSync(node_path_1.default.join(gameCiCustomHooksPath, file), `utf8`);
if (fileContentsObject.hook === hookLifecycle) { const fileContentsObject = yaml_1.default.parse(fileContents.toString());
remote_client_logger_1.RemoteClientLogger.log(`Active Hook File ${file} \n \n file contents: \n ${fileContents}`); if (fileContentsObject.hook === hookLifecycle) {
await cloud_runner_system_1.CloudRunnerSystem.Run(fileContentsObject.commands); remote_client_logger_1.RemoteClientLogger.log(`Active Hook File ${file} \n \n file contents: \n ${fileContents}`);
await cloud_runner_system_1.CloudRunnerSystem.Run(fileContentsObject.commands);
}
} }
} }
catch (error) {
remote_client_logger_1.RemoteClientLogger.log(JSON.stringify(error, undefined, 4));
}
} }
static async handleRetainedWorkspace() { static async handleRetainedWorkspace() {
if (!cloud_runner_1.default.buildParameters.retainWorkspace) { if (!cloud_runner_1.default.buildParameters.retainWorkspace) {

2
dist/index.js.map generated vendored

File diff suppressed because one or more lines are too long

View File

@ -139,14 +139,18 @@ export class RemoteClient {
static async runCustomHookFiles(hookLifecycle: string) { static async runCustomHookFiles(hookLifecycle: string) {
RemoteClientLogger.log(`RunCustomHookFiles: ${hookLifecycle}`); RemoteClientLogger.log(`RunCustomHookFiles: ${hookLifecycle}`);
const gameCiCustomHooksPath = path.join(CloudRunnerFolders.repoPathAbsolute, `game-ci`, `hooks`); const gameCiCustomHooksPath = path.join(CloudRunnerFolders.repoPathAbsolute, `game-ci`, `hooks`);
const files = fs.readdirSync(gameCiCustomHooksPath); try {
for (const file of files) { const files = fs.readdirSync(gameCiCustomHooksPath);
const fileContents = fs.readFileSync(path.join(gameCiCustomHooksPath, file), `utf8`); for (const file of files) {
const fileContentsObject = YAML.parse(fileContents.toString()); const fileContents = fs.readFileSync(path.join(gameCiCustomHooksPath, file), `utf8`);
if (fileContentsObject.hook === hookLifecycle) { const fileContentsObject = YAML.parse(fileContents.toString());
RemoteClientLogger.log(`Active Hook File ${file} \n \n file contents: \n ${fileContents}`); if (fileContentsObject.hook === hookLifecycle) {
await CloudRunnerSystem.Run(fileContentsObject.commands); RemoteClientLogger.log(`Active Hook File ${file} \n \n file contents: \n ${fileContents}`);
await CloudRunnerSystem.Run(fileContentsObject.commands);
}
} }
} catch (error) {
RemoteClientLogger.log(JSON.stringify(error, undefined, 4));
} }
} }
static async handleRetainedWorkspace() { static async handleRetainedWorkspace() {