Skip to content

Instantly share code, notes, and snippets.

@hum-n
Created May 15, 2020 16:15
Show Gist options
  • Save hum-n/aff758e21f09f96ff58dd45d2cbe023f to your computer and use it in GitHub Desktop.
Save hum-n/aff758e21f09f96ff58dd45d2cbe023f to your computer and use it in GitHub Desktop.
const { spawnSync } = require('child_process');
function run(cmd, args) {
return spawnSync(cmd, args, { stdio: 'inherit' });
}
function clone(dest) {
const cmd = run('git', ['clone', '--depth=1', url, dest]);
if (cmd.status == 0) {
run('rm', ['-rf', `${dest}/.git`]);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment