Skip to content

Commit

Permalink
Implement a helper script to pull AWS from env (stream-labs#1124)
Browse files Browse the repository at this point in the history
  • Loading branch information
computerquip-streamlabs authored and avacreeth committed Dec 11, 2018
1 parent c8200d4 commit 7961e47
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions bin/aws-wrapper.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
const cp = require('child_process');

const args = process.argv.splice(3);
const secretKey = process.env['AWS_SECRET_ACCESS_KEY'];
const accessKey = process.env['AWS_ACCESS_KEY_ID'];

if (!secretKey || !accessKey) {
console.log('AWS environment keys missing!');
return;
}

if (args.includes('--secret-access-key') || args.includes('--access-key')) {
console.log('AWS environment already given in CLI commands!');
console.log('Just call the script directly');
return;
}

args.push('--secret-access-key', secretKey);
args.push('--access-key', accessKey);

console.log(`Wrapping ${process.argv[2]} with arguments ${args}`)

cp.fork(process.argv[2], args);

0 comments on commit 7961e47

Please sign in to comment.