Created
May 26, 2021 03:59
-
-
Save pedropalhari/7b047d3b72620858c868aa49f85125a4 to your computer and use it in GitHub Desktop.
bash helper for linux shell scripts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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