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
@@ -12,15 +12,13 @@ export class GitCloneCommand 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 {
const { options, repository, directory } = this.parseArgs(args);
@@ -37,7 +35,7 @@ export class GitCloneCommand implements GitSubcommand {
targetDir = repoName.replace(/\.git$/, ''); // Remove .git suffix if present
}
const targetPath = `${this.pwd}/${targetDir}`;
const targetPath = `${cwd}/${targetDir}`;
// Check if target directory already exists
try {
@@ -117,4 +115,4 @@ export class GitCloneCommand implements GitSubcommand {
return { options, repository, directory };
}
}
}