Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@gauntface/cli

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@gauntface/cli - npm Package Compare versions

Comparing version 0.0.5 to 0.0.6

48

gauntface-aws-s3-deploy-static-site.js

@@ -1,6 +0,12 @@

const util = require('util');
const exec = util.promisify(require('child_process').exec);
const spawn = require('child_process').spawn;
const { program } = require('commander');
program
run().catch((err) => {
console.error(`☠️ An unexpected error occured.`);
console.error(err);
return process.exit(1);
})
async function run() {
program
.version('0.0.1')

@@ -10,12 +16,13 @@ .requiredOption('--directory <type>', 'Directory of the site to upload')

program.parse(process.argv);
program.parse(process.argv);
const opts = program.opts();
const opts = program.opts();
const directory = opts.directory;
const bucketName = opts['bucket_name'];
const directory = opts.directory;
const bucketName = opts['bucket_name'];
logMetadata(directory, bucketName);
logMetadata(directory, bucketName);
publishToS3Bucket(directory, bucketName);
await publishToS3Bucket(directory, bucketName);
}

@@ -72,3 +79,24 @@ function logMetadata(directory, bucketName) {

console.log(`🤖 Running \`${cmd}\``);
await exec(cmd);
const cmdPieces = cmd.split(' ');
return new Promise((resolve, reject) => {
// Note: We use spawn here since exec has a max buffer size for stdout and stderr that
// AWS blasts through
const cmdProcess = spawn(cmdPieces[0], cmdPieces.splice(1))
cmdProcess.stdout.on('data', function (data) {
console.log(`${data}`);
});
cmdProcess.stderr.on('data', function (data) {
console.error(`${data}`);
});
cmdProcess.on('close', function (code) {
if (code != 0) {
reject(`Unexpected error code: ${code}`);
return
}
resolve();
});
});
}

@@ -6,3 +6,3 @@ {

},
"version": "0.0.5",
"version": "0.0.6",
"description": "A CLI tool to help with repetitive tasks.",

@@ -9,0 +9,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc