Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@gro-ove
Last active August 14, 2016 12:34
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 gro-ove/93693b42fed1b1daeec7d142ad9baf10 to your computer and use it in GitHub Desktop.
Save gro-ove/93693b42fed1b1daeec7d142ad9baf10 to your computer and use it in GitHub Desktop.
Wrapping zsh- or js-script inside a bat-file (for drag'n'drops)
// 2>nul & node %0 "%1" "%2" "%3" "%4" "%5" & goto :eof
var fs = require('fs');
var readline = require('readline');
console.log('\u001BcNode.JS is here!');
console.log(` Working dir: ${__dirname}`);
console.log(` Arguments: ${process.argv.slice(2).join(' ')}`);
var rl = readline.createInterface({
input: process.stdin,
output: process.stdout
});
rl.question('<Press Enter>', a => {
rl.close();
});
# 2>nul & zsh %0 "%1" "%2" "%3" "%4" "%5" & goto :eof
echo "cZSH is here!"
echo " Working dir: ${0:h}"
echo " Arguments: ${(j: :)@}"
echo "<Press Enter>"
read _
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment