@modyo/widget
Version:
is a widget boilerplater
20 lines (18 loc) • 575 B
JavaScript
import execa from 'execa'
import chalk from 'chalk'
import { exists, removeDir } from './fs-helpers'
const cloneRepo = async (options) => {
if (exists(options.tempGitPath)) {
chalk.bgGreen.black.bold('Removing existing file')
await removeDir(options.tempGitPath)
}
const result = await execa('git', ['clone', 'git@github.com:modyo/financial-widgets.git'], {
cwd: options.tempObj.name
})
if (!result || result.failed) {
return Promise.reject(new Error('Failed to initialize git'))
}
return result
}
export { cloneRepo }
export default cloneRepo