refactor: implemented $PWD > cwd to prevent macOS symlink resolution
- Replaced all direct `process.cwd()` calls with `getProjectDir()` utility function across 40+ files to centralize project directory resolution logic. - Added `getProjectDir()` and `setProjectDir()` functions to `@oh-my-pi/pi-utils/dirs` module to provide abstracted project directory management. - Made `SessionManager.list()` method asynchronous to support asynchronous session discovery operations. - Updated default working directory resolution throughout codebase to use `getProjectDir()` instead of `process.cwd()` for improved project directory detection.
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
* System information collection for debug reports.
|
||||
*/
|
||||
import * as os from "node:os";
|
||||
import { VERSION } from "@oh-my-pi/pi-utils/dirs";
|
||||
import { getProjectDir, VERSION } from "@oh-my-pi/pi-utils/dirs";
|
||||
|
||||
export interface SystemInfo {
|
||||
os: string;
|
||||
@@ -65,7 +65,7 @@ export async function collectSystemInfo(): Promise<SystemInfo> {
|
||||
bun: Bun.version,
|
||||
node: process.version,
|
||||
},
|
||||
cwd: process.cwd(),
|
||||
cwd: getProjectDir(),
|
||||
shell,
|
||||
terminal,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user