mirror of
https://gitlab.com/soapbox-pub/shakespeare.git
synced 2026-12-06 00:27:24 +00:00
Fix cwd in git commands
This commit is contained in:
29 files changed
+384
-461
No files matched your search
@@ -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 };
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user