1 Star 0 Fork 0

代码织梦师/Ranch-admin

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
refreshThelingUtil.ts 804 Bytes
一键复制 编辑 原始数据 按行查看 历史
A.ZJT(涛涛) 提交于 2023-09-19 19:19 +08:00 . feat: 全局刷新依赖方法构建
const rimrafUtils = require('rimraf');
const execSyncUtils = require('child_process').execSync;
const refreshThelingUtils = async () => {
await removeDirUtils('src/.umi');
await removeDirUtils('node_modules/.cache');
await removeDirUtils('pnpm-lock.yaml');
try {
execSyncUtils('pnpm remove @theling/utils', { stdio: 'inherit' });
} catch (e) {
console.log('移除旧的依赖失败', e);
}
execSyncUtils('pnpm store prune', { stdio: 'inherit' });
// 安装最新的依赖
execSyncUtils('pnpm i @theling/utils --force', { stdio: 'inherit' });
};
const removeDirUtils = (dir: any) =>
new Promise((resolve, reject) => {
rimrafUtils(dir, (err: any) => {
if (err) {
reject(err);
} else {
resolve({});
}
});
});
refreshThelingUtils();
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/zhao-jingtao-l/ranch-admin.git
git@gitee.com:zhao-jingtao-l/ranch-admin.git
zhao-jingtao-l
ranch-admin
Ranch-admin
master

搜索帮助