run init script in projectDir

This commit is contained in:
Zoe
2025-01-15 20:27:20 +00:00
parent dd6d3b02df
commit 559ba6f8f0
2 changed files with 2 additions and 1 deletions

View File

@@ -76,7 +76,7 @@ Every initialize script is expected to follow a few rules:
- The project must be a zqdgr project - The project must be a zqdgr project
- The `build` script must exist and must export a binary named `main` - 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 - go.mod
- main.go - main.go

View File

@@ -368,6 +368,7 @@ func main() {
} }
cmd = exec.Command(filepath.Join(tempDir, "main"), projectDir) cmd = exec.Command(filepath.Join(tempDir, "main"), projectDir)
cmd.Dir = projectDir
err = cmd.Run() err = cmd.Run()
if err != nil { if err != nil {