mirror of
https://gitee.com/bootx/dax-pay-ui.git
synced 2025-09-09 05:29:32 +00:00
chore: repair window system execution command failure
This commit is contained in:
@@ -1,21 +1,21 @@
|
||||
// #!/usr/bin/env node
|
||||
|
||||
// import { sh } from 'tasksfile';
|
||||
import { sh } from 'tasksfile';
|
||||
|
||||
import { argv } from 'yargs';
|
||||
import { runBuildConfig } from './buildConf';
|
||||
import { runUpdateHtml } from './updateHtml';
|
||||
import { errorConsole, successConsole, run } from '../utils';
|
||||
import { errorConsole, successConsole } from '../utils';
|
||||
|
||||
export const runBuild = async () => {
|
||||
try {
|
||||
const argvList = argv._;
|
||||
// let cmd = `cross-env NODE_ENV=production vite build`;
|
||||
await run('cross-env', ['NODE_ENV=production', 'vite', 'build']);
|
||||
// await sh(cmd, {
|
||||
// async: true,
|
||||
// nopipe: true,
|
||||
// });
|
||||
let cmd = `cross-env NODE_ENV=production vite build`;
|
||||
// await run('cross-env', ['NODE_ENV=production', 'vite', 'build']);
|
||||
await sh(cmd, {
|
||||
async: true,
|
||||
nopipe: true,
|
||||
});
|
||||
|
||||
// Generate configuration file
|
||||
if (!argvList.includes('no-conf')) {
|
||||
|
@@ -1,29 +1,20 @@
|
||||
// #!/usr/bin/env node
|
||||
|
||||
// import { sh } from 'tasksfile';
|
||||
import { errorConsole, successConsole, run } from '../utils';
|
||||
import { sh } from 'tasksfile';
|
||||
import { errorConsole, successConsole } from '../utils';
|
||||
|
||||
export const runChangeLog = async () => {
|
||||
try {
|
||||
// let cmd = `conventional-changelog -p custom-config -i CHANGELOG.md -s -r 0 `;
|
||||
await run('conventional-changelog', [
|
||||
'-p',
|
||||
'custom-config',
|
||||
'-i',
|
||||
'CHANGELOG.md',
|
||||
'-s',
|
||||
'-r',
|
||||
'-0',
|
||||
]);
|
||||
// await sh(cmd, {
|
||||
// async: true,
|
||||
// nopipe: true,
|
||||
// });
|
||||
await run('prettier', ['--write', '**/CHANGELOG.md']);
|
||||
// await sh('prettier --write **/CHANGELOG.md ', {
|
||||
// async: true,
|
||||
// nopipe: true,
|
||||
// });
|
||||
let cmd = `conventional-changelog -p custom-config -i CHANGELOG.md -s -r 0 `;
|
||||
|
||||
await sh(cmd, {
|
||||
async: true,
|
||||
nopipe: true,
|
||||
});
|
||||
await sh('prettier --write **/CHANGELOG.md ', {
|
||||
async: true,
|
||||
nopipe: true,
|
||||
});
|
||||
successConsole('CHANGE_LOG.md generated successfully!');
|
||||
} catch (error) {
|
||||
errorConsole('CHANGE_LOG.md generated error\n' + error);
|
||||
|
@@ -3,8 +3,8 @@
|
||||
import path from 'path';
|
||||
import fs from 'fs-extra';
|
||||
import { isEqual } from 'lodash';
|
||||
// import { sh } from 'tasksfile';
|
||||
import { successConsole, errorConsole, run } from '../utils';
|
||||
import { sh } from 'tasksfile';
|
||||
import { successConsole, errorConsole } from '../utils';
|
||||
|
||||
const resolve = (dir: string) => {
|
||||
return path.resolve(process.cwd(), dir);
|
||||
@@ -46,11 +46,10 @@ export async function runPreserve() {
|
||||
'A dependency change is detected, and the dependency is being installed to ensure that the dependency is consistent! (Tip: The project will be executed for the first time)!'
|
||||
);
|
||||
try {
|
||||
await run('npm', ['run', 'bootstrap']);
|
||||
// await sh('npm run bootstrap ', {
|
||||
// async: true,
|
||||
// nopipe: true,
|
||||
// });
|
||||
await sh('npm run bootstrap ', {
|
||||
async: true,
|
||||
nopipe: true,
|
||||
});
|
||||
|
||||
successConsole('Dependency installation is successful, start running the project!');
|
||||
|
||||
|
@@ -1,12 +1,12 @@
|
||||
import chalk from 'chalk';
|
||||
import Koa from 'koa';
|
||||
import inquirer from 'inquirer';
|
||||
// import { sh } from 'tasksfile';
|
||||
import { sh } from 'tasksfile';
|
||||
import staticServer from 'koa-static';
|
||||
import portfinder from 'portfinder';
|
||||
import { resolve } from 'path';
|
||||
import viteConfig from '../../vite.config';
|
||||
import { getIPAddress, run } from '../utils';
|
||||
import { getIPAddress } from '../utils';
|
||||
|
||||
const BUILD = 1;
|
||||
const NO_BUILD = 2;
|
||||
@@ -53,11 +53,10 @@ export const runPreview = async () => {
|
||||
});
|
||||
const { type } = await prompt;
|
||||
if (type === BUILD) {
|
||||
await run('npm', ['run', 'build']);
|
||||
// await sh('npm run build', {
|
||||
// async: true,
|
||||
// nopipe: true,
|
||||
// });
|
||||
await sh('npm run build', {
|
||||
async: true,
|
||||
nopipe: true,
|
||||
});
|
||||
}
|
||||
startApp();
|
||||
};
|
||||
|
Reference in New Issue
Block a user