Skip to content

Instantly share code, notes, and snippets.

@scripting
Created April 28, 2020 22:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save scripting/68984626822359ae2bec1112719f1f2c to your computer and use it in GitHub Desktop.
Save scripting/68984626822359ae2bec1112719f1f2c to your computer and use it in GitHub Desktop.
Run an AWS command line script from a Node app (demo)
#!/bin/sh
aws s3 cp example.sh s3://scripting.com/tmp/example.sh --acl public-read
{
"name": "shellexec",
"description": "Test app to run a shell script from a node app",
"author": "Dave Winer <dave@scripting.com>",
"version": "0.4.0",
"scripts": {
"start": "node test.js"
},
"dependencies" : {
"shelljs": "*"
},
"license": "MIT",
"engines": {
"node": "*"
}
}
const shell = require ("shelljs");
shell.exec ("sh example.sh");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment