Skip to content

Commit

Permalink
fix: add some default value for tmp dir #231 (#233)
Browse files Browse the repository at this point in the history
  • Loading branch information
yuyutaotao authored Jan 2, 2025
1 parent db3ccde commit 8d83deb
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/shared/src/fs/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import assert from 'node:assert';
import { existsSync, readFileSync } from 'node:fs';
import { dirname, join } from 'node:path';

Expand All @@ -24,7 +23,11 @@ export function getRunningPkgInfo(dir?: string): PkgInfo | null {

if (pkgDir && pkgJsonFile) {
const { name, version } = JSON.parse(readFileSync(pkgJsonFile, 'utf-8'));
pkgCacheMap[dirToCheck] = { name, version, dir: pkgDir };
pkgCacheMap[dirToCheck] = {
name: name || 'midscene-unknown-package-name',
version: version || '0.0.0',
dir: pkgDir,
};
return pkgCacheMap[dirToCheck];
}
return {
Expand Down

0 comments on commit 8d83deb

Please sign in to comment.