xbp-cli
Version:
A simple CLI for scaffolding Vue.js projects.
19 lines (16 loc) • 416 B
JavaScript
const path = require('path')
module.exports = {
/**
* 检测当前路径到模板是否为本地模板
* @param {*} templatePath
* @returns
*/
isLocalPath (templatePath) {
return /^[./]|(^[a-zA-Z]:)/.test(templatePath)
},
getTemplatePath (templatePath) {
return path.isAbsolute(templatePath)
? templatePath
: path.normalize(path.join(process.cwd(), templatePath))
}
}