Skip to content

Instantly share code, notes, and snippets.

@pedropalhari
Created May 26, 2021 03:59
Show Gist options
  • Save pedropalhari/7b047d3b72620858c868aa49f85125a4 to your computer and use it in GitHub Desktop.
Save pedropalhari/7b047d3b72620858c868aa49f85125a4 to your computer and use it in GitHub Desktop.
bash helper for linux shell scripts
const { execSync } = require("child_process");
function bash(template, ...substitutions) {
let command = String.raw(template, substitutions);
let out = execSync(command);
return out.toString();
}
bash`ls -lah .`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment