Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function downloadCountryList(cb) {
mkdirpSync('build');
clone(
'https://github.com/umpirsky/country-list.git',
REPO_PATH,
{ shallow: true },
cb
);
}
function downloadCountryList(cb) {
mkdirpSync('build');
clone('https://github.com/umpirsky/country-list.git', REPO_PATH, {shallow: true}, cb);
}
return new Promise((resolve, reject) => {
clone(git, tmp, { clone: clone }, function (err) {
spinner.stop()
if (err) {
error('Failed to download repo ' + git + ': ' + err.message.trim())
reject(err)
}
resolve(tmp)
})
})
}
return new Promise((resolve) => {
try {
gitClone(template, tmp, { checkout: version }, (error) => {
if (error) {
spinner.fail();
log.error(
`Failed to download the template from ${chalk.bold(template)} using ${chalk.bold(version)}`,
error
);
}
spinner.succeed();
removeSync(path.join(tmp, '.git'));
resolve(tmp);
});
} catch (error) {
log.error('An error happened when downloading the template.', error);
}
await new Promise((resolve, reject) => {
gitClone(repoUrl, projectCwd, (err) => {
if (err) {
const error = new Error(`Failed to clone "${repoUrl}" - ${err.message}`)
error.originalError = err
reject(error)
} else {
resolve()
}
})
})