Created
May 15, 2020 16:15
-
-
Save hum-n/aff758e21f09f96ff58dd45d2cbe023f to your computer and use it in GitHub Desktop.
This file contains 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 { 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