10 Star 207 Fork 61

beifengtz/vue-web-terminal

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
package.js 1.24 KB
一键复制 编辑 原始数据 按行查看 历史
import path from 'path'
import fs from 'fs'
function copyDir(src, dest) {
fs.mkdirSync(dest)
for (let f of fs.readdirSync(src)) {
fs.copyFileSync(path.join(src, f), path.join(dest, f));
}
console.log('copied', `'${src}'`, '-->', `'${dest}'`)
}
function deleteFile(fileOrDirName) {
let stat = fs.statSync(fileOrDirName)
if (stat.isDirectory()) {
for (let f of fs.readdirSync(fileOrDirName)) {
let filePath = path.join(fileOrDirName, f)
deleteFile(filePath)
}
fs.rmdirSync(fileOrDirName)
} else {
fs.unlinkSync(fileOrDirName)
console.log(`deleted ==> ${fileOrDirName}`)
}
}
function deleteFileWithPattern(dir, regexp) {
for (let f of fs.readdirSync(dir)) {
if (f.match(regexp)) {
fs.unlinkSync(path.join(dir, f))
console.log(`deleted ==> ${dir}/${f}`)
}
}
}
function copyTypes() {
fs.copyFileSync('./lib/types/index.d.ts', './lib/types.d.ts')
deleteFile('./lib/types')
console.log(`copied types.d.ts`)
}
// copyDir('./src/css/theme', './lib/theme');
deleteFile('./lib/ansi')
deleteFile('./lib/common')
deleteFile('./lib/components')
deleteFileWithPattern('./lib', /\.(png|gif|jpg)/)
// copyTypes()
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/tzfun/vue-web-terminal.git
[email protected]:tzfun/vue-web-terminal.git
tzfun
vue-web-terminal
vue-web-terminal
vue3

搜索帮助