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:
parent
0efa7810d2
commit
6e00d76396
2 changed files with 16 additions and 16 deletions
16
lib/index.js
16
lib/index.js
|
@ -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
|
* 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.`);
|
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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
|
16
src/main.ts
16
src/main.ts
|
@ -9,6 +9,14 @@ interface FileInfo {
|
||||||
options: fs.WriteFileOptions;
|
options: fs.WriteFileOptions;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
main();
|
||||||
|
} catch (err) {
|
||||||
|
if (err instanceof Error) {
|
||||||
|
core.setFailed(err);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* main function
|
* 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.`);
|
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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue