Skip to content

Commit

Permalink
[Bug] 修复 repo 日志文件夹不存在的时候的报错
Browse files Browse the repository at this point in the history
  • Loading branch information
VisualSJ committed Nov 24, 2023
1 parent f823853 commit 72b9950
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@itharbors/workflow",
"version": "0.2.3",
"version": "0.2.4",
"description": "",
"main": "./dist/index.js",
"scripts": {
Expand Down
5 changes: 4 additions & 1 deletion source/internal/npm.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import {
join,
dirname,
isAbsolute,
} from 'path';
import {
createWriteStream,
WriteStream,
} from 'fs';
ensureDir,
} from 'fs-extra';

import { gray } from 'chalk';

Expand Down Expand Up @@ -58,6 +60,7 @@ export class NPMTask extends Task {
try {
let writeStream: WriteStream | undefined;
if (config.logFile) {
await ensureDir(dirname(config.logFile));
writeStream = createWriteStream(config.logFile, { flags: 'a' });
}
await bash('npm', config.params, {
Expand Down

0 comments on commit 72b9950

Please sign in to comment.