1 Star 0 Fork 60

zkvvv/vue-web-terminal

forked from beifengtz/vue-web-terminal 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
package.js 1.23 KB
一键复制 编辑 原始数据 按行查看 历史
beifengtz 提交于 2023-12-21 10:56 . [vue3] publish 3.2.1
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/zkvvv/vue-web-terminal.git
git@gitee.com:zkvvv/vue-web-terminal.git
zkvvv
vue-web-terminal
vue-web-terminal
vue3

搜索帮助

0d507c66 1850385 C8b1a773 1850385