Skip to content

Instantly share code, notes, and snippets.

@jpalala
Created November 15, 2023 01:00
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 jpalala/fa88a31e92df49ad1beb2c538ad49a69 to your computer and use it in GitHub Desktop.
Save jpalala/fa88a31e92df49ad1beb2c538ad49a69 to your computer and use it in GitHub Desktop.
zat
# some utility function to copy changed files to a backup folder
var shell = require('shelljs');
if (!shell.which('git')) {
shell.echo('Sorry, this script requires git');
shell.exit(1);
}
if (shell.exec("git status porcelain | awk 'print $2' > tempfile").code !== 0) {
shell.echo("check tempfile");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment