Skip to content

Commit 7961e47

Browse files
computerquip-streamlabsavacreeth
authored andcommitted
Implement a helper script to pull AWS from env (#1124)
1 parent c8200d4 commit 7961e47

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

bin/aws-wrapper.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
const cp = require('child_process');
2+
3+
const args = process.argv.splice(3);
4+
const secretKey = process.env['AWS_SECRET_ACCESS_KEY'];
5+
const accessKey = process.env['AWS_ACCESS_KEY_ID'];
6+
7+
if (!secretKey || !accessKey) {
8+
console.log('AWS environment keys missing!');
9+
return;
10+
}
11+
12+
if (args.includes('--secret-access-key') || args.includes('--access-key')) {
13+
console.log('AWS environment already given in CLI commands!');
14+
console.log('Just call the script directly');
15+
return;
16+
}
17+
18+
args.push('--secret-access-key', secretKey);
19+
args.push('--access-key', accessKey);
20+
21+
console.log(`Wrapping ${process.argv[2]} with arguments ${args}`)
22+
23+
cp.fork(process.argv[2], args);

0 commit comments

Comments
 (0)