Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix actions on windows runners #6

Merged
merged 2 commits into from
Jun 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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.