From 559ba6f8f086b557d3ed31b6aff3667e20381d86 Mon Sep 17 00:00:00 2001 From: Zoe <62722391+juls0730@users.noreply.github.com> Date: Wed, 15 Jan 2025 20:27:20 +0000 Subject: [PATCH] run init script in projectDir --- README.md | 2 +- main.go | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 47b061e..4b04a97 100644 --- a/README.md +++ b/README.md @@ -76,7 +76,7 @@ Every initialize script is expected to follow a few rules: - The project must be a zqdgr project - The `build` script must exist and must export a binary named `main` -ZQDGR passes your init script the directory that is being initialized as the first and only argument. When your binary is executed, there is a git repository and the project is in the following state: +ZQDGR passes your init script the directory that is being initialized as the first and only argument and runs the script in the target directory. When your binary is executed, there is a git repository and the project is in the following state: - go.mod - main.go diff --git a/main.go b/main.go index 0428dbe..e9aaa0d 100644 --- a/main.go +++ b/main.go @@ -368,6 +368,7 @@ func main() { } cmd = exec.Command(filepath.Join(tempDir, "main"), projectDir) + cmd.Dir = projectDir err = cmd.Run() if err != nil {