1
0
Fork 0
mirror of https://github.com/shimataro/ssh-key-action.git synced 2025-06-19 22:52:10 +10:00

move calling main to front

This commit is contained in:
shimataro 2022-10-30 19:32:56 +09:00
parent 0efa7810d2
commit 6e00d76396
No known key found for this signature in database
GPG key ID: BE92C05736911A9D
2 changed files with 16 additions and 16 deletions

View file

@ -586,6 +586,14 @@ __nccwpck_require__.r(__webpack_exports__);
try {
main();
}
catch (err) {
if (err instanceof Error) {
_actions_core__WEBPACK_IMPORTED_MODULE_2__.setFailed(err);
}
}
/**
* main function
*/
@ -727,14 +735,6 @@ function shouldCreateKeyFile(keyFilePath, ifKeyExists) {
throw new Error(`SSH key is already installed. Set "if_key_exists" to "replace" or "ignore" in order to avoid this error.`);
}
}
try {
main();
}
catch (err) {
if (err instanceof Error) {
_actions_core__WEBPACK_IMPORTED_MODULE_2__.setFailed(err);
}
}
})();

View file

@ -9,6 +9,14 @@ interface FileInfo {
options: fs.WriteFileOptions;
}
try {
main();
} catch (err) {
if (err instanceof Error) {
core.setFailed(err);
}
}
/**
* main function
*/
@ -167,11 +175,3 @@ function shouldCreateKeyFile(keyFilePath: string, ifKeyExists: string): boolean
throw new Error(`SSH key is already installed. Set "if_key_exists" to "replace" or "ignore" in order to avoid this error.`);
}
}
try {
main();
} catch (err) {
if (err instanceof Error) {
core.setFailed(err);
}
}