Due to node issue using exit code 0 for exceptions thrown in async methods.
Fixed by moving getUserArguments inside try block.
This commit is contained in:
SamKirkland
2020-05-02 02:14:10 -05:00
parent c42c8e46fb
commit a54cf4c5e3
3 changed files with 638 additions and 46 deletions

View File

@@ -5,18 +5,19 @@ import { promisify } from 'util';
import { IActionArguments } from './types';
const writeFileAsync = promisify(fs.writeFile);
const errorDeploying = "⚠️ Error deploying";
async function run() {
const userArguments = getUserArguments();
try {
const userArguments = getUserArguments();
await configureHost(userArguments);
await syncFiles(userArguments);
console.log("✅ Deploy Complete");
}
catch (error) {
console.error("⚠️ Error deploying");
console.error(errorDeploying);
core.setFailed(error.message);
}
}
@@ -40,7 +41,7 @@ async function configureHost(args: IActionArguments): Promise<void> {
}
catch (error) {
console.error("⚠️ Error configuring known_hosts");
throw error;
core.setFailed(error.message);
}
}
@@ -75,6 +76,5 @@ async function syncFiles(args: IActionArguments) {
catch (error) {
console.error("⚠️ Failed to upload files");
core.setFailed(error.message);
throw error;
}
}