Skip to content

Commit

Permalink
Update complie.js
Browse files Browse the repository at this point in the history
  // 检查 tsconfig.json 是否存在
  const tsconfigPath = path.resolve(cwd, 'tsconfig.json');
  try {
    await fsp.access(tsconfigPath, fs.constants.F_OK);
    console.log('tsconfig.json 存在,不执行 "npm run usage" 命令。');
  } catch (err) {
    // 如果 tsconfig.json 不存在,则执行 "npm run usage"
    await execCommand('npm run usage', {
      throwWhenStderr: false,
      cwd,
    });
  }
  • Loading branch information
lyjamare authored Sep 24, 2024
1 parent bae5383 commit 700b321
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions script/temp/lifecycle/complie.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,19 @@ const feBuild = async (package) => {
await execCommands(['npm install --force', 'npm run build'], {
cwd,
});
await execCommand('npm run usage', {
throwWhenStderr: false,
cwd,
});

// 检查 tsconfig.json 是否存在
const tsconfigPath = path.resolve(cwd, 'tsconfig.json');
try {
await fsp.access(tsconfigPath, fs.constants.F_OK);
console.log('tsconfig.json 存在,不执行 "npm run usage" 命令。');
} catch (err) {
// 如果 tsconfig.json 不存在,则执行 "npm run usage"
await execCommand('npm run usage', {
throwWhenStderr: false,
cwd,
});
}
};

const beBuild = async ({ cwd }) => {
Expand Down

0 comments on commit 700b321

Please sign in to comment.