chore: remove Chinese path warning

This commit is contained in:
vben
2020-10-24 01:52:37 +08:00
parent a9c2a29d9d
commit 62ba7a5a53
7 changed files with 18 additions and 55 deletions

View File

@@ -4,7 +4,6 @@ import chalk from 'chalk';
import { argv } from 'yargs';
import { runChangeLog } from './changelog';
import { runPostInstall } from './postinstall';
import { runPreview } from './preview';
// import { runPreserve } from './preserve';
import { runBuild } from './build';
@@ -27,10 +26,6 @@ switch (task) {
// runPreserve();
// break;
case 'postinstall':
runPostInstall();
break;
case 'preview':
runPreview();
break;

View File

@@ -1,15 +0,0 @@
import { exec, which } from 'shelljs';
function ignoreCaseGit() {
try {
if (which('git').code === 0) {
exec('git config core.ignorecase false ');
}
} catch (error) {
console.log(error);
}
}
export function runPostInstall() {
ignoreCaseGit();
}

View File

@@ -4,25 +4,29 @@ import path from 'path';
import fs from 'fs-extra';
import { isEqual } from 'lodash';
import { sh } from 'tasksfile';
import { successConsole, errorConsole } from '../utils';
import {
successConsole,
// errorConsole
} from '../utils';
const resolve = (dir: string) => {
return path.resolve(process.cwd(), dir);
};
const reg = /[\u4E00-\u9FA5\uF900-\uFA2D]/;
// const reg = /[\u4E00-\u9FA5\uF900-\uFA2D]/;
let NEED_INSTALL = false;
export async function runPreserve() {
const cwdPath = process.cwd();
if (reg.test(cwdPath)) {
errorConsole(
'Do not include Chinese, Japanese or Korean in the full path of the project directory, please modify the directory name and run again!'
);
errorConsole('项目目录全路径请勿包含中文、日文、韩文,请修改目录名后再次重新运行!');
process.exit(1);
}
// rc.6 fixed
// const cwdPath = process.cwd();
// if (reg.test(cwdPath)) {
// errorConsole(
// 'Do not include Chinese, Japanese or Korean in the full path of the project directory, please modify the directory name and run again!'
// );
// errorConsole('项目目录全路径请勿包含中文、日文、韩文,请修改目录名后再次重新运行!');
// process.exit(1);
// }
fs.mkdirp(resolve('build/.cache'));
function checkPkgUpdate() {