Fix cwd in git commands

This commit is contained in:
Alex Gleason committed 2025-11-23 10:13:51 -06:00
1 parent 30ead01178
commit fcc2b9902a
29 files changed
+384 -461

No files matched your search

+3 -5
View File
@@ -11,19 +11,17 @@ export class GitInitCommand implements GitSubcommand {
private git: Git;
private fs: JSRuntimeFS;
private pwd: string;
constructor(options: GitSubcommandOptions) {
this.git = options.git;
this.fs = options.fs;
this.pwd = options.pwd;
}
async execute(args: string[]): Promise<ShellCommandResult> {
async execute(args: string[], cwd: string): Promise<ShellCommandResult> {
try {
// Parse arguments
const { options, directory } = this.parseArgs(args);
const targetDir = directory || this.pwd;
const targetDir = directory || cwd;
// Check if directory exists, create if needed
if (directory) {
@@ -88,4 +86,4 @@ export class GitInitCommand implements GitSubcommand {
return { options, directory };
}
}
}