UNPKG

bia

Version:

a tool for download git repository

26 lines (23 loc) 711 B
/* * @Author: hzxulin@yeah.net * @Date: 2018-02-01 14:04:04 * @Last Modified by: hzxulin@yeah.net * @Last Modified time: 2019-06-01 18:12:13 */ const path = require('path') const utils = require('./utils') module.exports = (origin, opts) => { switch (origin) { case 'default': default: { utils.cloneGit(origin, opts.branch || 'master', opts.file ? '项目更新中...' : '').then(tpl => { return utils.moveFiles(opts.file, tpl, path.resolve(process.cwd(), opts.dist || '')) }).then(() => { utils.showSuccess() }).catch(err => { console.log(err) }) break } } }