From 5e61fdf6fdc6ae502312f71e1191ec53f7851ad9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9ctor=20Ram=C3=B3n=20Jim=C3=A9nez?= Date: Thu, 15 Aug 2019 23:32:28 +0200 Subject: [PATCH] Await properly for commands to finish --- lib/main.js | 4 ++-- src/main.ts | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/main.js b/lib/main.js index 76d52c0..8a7eb2e 100644 --- a/lib/main.js +++ b/lib/main.js @@ -24,8 +24,8 @@ function run() { const version = core.getInput('rust-version'); if (version) { yield rustup.install(version); - exec.exec('rustup', ['default', version]); - exec.exec('rustup', ['update', version]); + yield exec.exec('rustup', ['default', version]); + yield exec.exec('rustup', ['update', version]); } } catch (error) { diff --git a/src/main.ts b/src/main.ts index 3984b4d..2b1852a 100644 --- a/src/main.ts +++ b/src/main.ts @@ -9,9 +9,8 @@ async function run() { if(version) { await rustup.install(version); - - exec.exec('rustup', ['default', version]); - exec.exec('rustup', ['update', version]); + await exec.exec('rustup', ['default', version]); + await exec.exec('rustup', ['update', version]); } } catch (error) { core.setFailed(error.message);