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 {