Skip to content

Commit

Permalink
fix: fix actions on windows runners (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
bryantbiggs committed Jun 21, 2020
1 parent 072d6ee commit e7aac78
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "aws-github-actions",
"version": "0.4.2",
"version": "0.4.3",
"description": "GitHub actions for AWS services",
"repository": {
"type": "git",
Expand Down
7 changes: 5 additions & 2 deletions packages/awscli-core/index.ts
Expand Up @@ -23,8 +23,11 @@ export default class AwsCli {

// Will throw an error if `aws` is not installed.
public static async get(): Promise<AwsCli> {
if (process.platform === 'win32') {
// Comes on windows runner provided by GitHub so remove
await exec.exec('rmdir', ['/Q', '/S', '"C:/Program Files/Amazon"']);
}
const exePath = await io.which('aws', true);

return new AwsCli(exePath);
}

Expand All @@ -40,7 +43,7 @@ export default class AwsCli {

case 'win32': {
const AwsCliMsiPath = await tc.downloadTool('https://awscli.amazonaws.com/AWSCLIV2.msi');
await exec.exec('msiexec.exe', ['/I', AwsCliMsiPath]);
await exec.exec('msiexec.exe', ['/i', AwsCliMsiPath, '/quiet']);
break;
}

Expand Down
12 changes: 10 additions & 2 deletions packages/awscli-core/lib/index.js
Expand Up @@ -70,8 +70,16 @@ var AwsCli = /** @class */ (function () {
var exePath;
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, io.which('aws', true)];
case 0:
if (!(process.platform === 'win32')) return [3 /*break*/, 2];
// Comes on windows runner provided by GitHub so remove
return [4 /*yield*/, exec.exec('rmdir', ['/Q', '/S', '"C:/Program Files/Amazon"'])];
case 1:
// Comes on windows runner provided by GitHub so remove
_a.sent();
_a.label = 2;
case 2: return [4 /*yield*/, io.which('aws', true)];
case 3:
exePath = _a.sent();
return [2 /*return*/, new AwsCli(exePath)];
}
Expand Down Expand Up @@ -102,7 +110,7 @@ var AwsCli = /** @class */ (function () {
case 4: return [4 /*yield*/, tc.downloadTool('https://awscli.amazonaws.com/AWSCLIV2.msi')];
case 5:
AwsCliMsiPath = _b.sent();
return [4 /*yield*/, exec.exec('msiexec.exe', ['/I', AwsCliMsiPath])];
return [4 /*yield*/, exec.exec('msiexec.exe', ['/i', AwsCliMsiPath, '/quiet'])];
case 6:
_b.sent();
return [3 /*break*/, 8];
Expand Down
2 changes: 1 addition & 1 deletion packages/awscli/dist/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/s3_sync/dist/index.js

Large diffs are not rendered by default.

0 comments on commit e7aac78

Please sign in to comment.