mirror of
https://github.com/SamKirkland/FTP-Deploy-Action.git
synced 2026-09-22 12:35:24 +02:00
Closes #60
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:
1 parent
c42c8e46fb
commit
a54cf4c5e3
3 files changed
+638
-46
No files matched your search
+5
-5
@@ -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;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user