From 3983ba60d12effad9e44a1999717f704ec9302a1 Mon Sep 17 00:00:00 2001 From: Erica Marigold Date: Thu, 18 Jul 2024 17:54:38 +0530 Subject: [PATCH] fix: incorrect copy src path --- build/build.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/build/build.go b/build/build.go index ffb1695..f578c6b 100644 --- a/build/build.go +++ b/build/build.go @@ -16,7 +16,7 @@ func bail(err error) { } } -func buildVm(artifactDir string, artifactPath string, cmakeFlags ...string) { +func buildVm(artifactPath string, cmakeFlags ...string) { dir, homeDirErr := os.MkdirTemp("", "lei-build") bail(homeDirErr) @@ -35,9 +35,9 @@ func buildVm(artifactDir string, artifactPath string, cmakeFlags ...string) { Exec("cmake", buildDir, "--build", ".", "--target Luau.VM", "--config", "RelWithDebInfo") // Copy the artifact to the artifact directory - artifactFile, artifactErr := os.ReadFile(artifactPath) + artifactFile, artifactErr := os.ReadFile(path.Join(buildDir, ARTIFACT_NAME)) bail(artifactErr) - bail(os.WriteFile(path.Join(artifactDir, ARTIFACT_NAME), artifactFile, os.ModePerm)) + bail(os.WriteFile(artifactPath, artifactFile, os.ModePerm)) } func main() { @@ -68,7 +68,7 @@ func main() { if _, err := os.Stat(artifactPath); err == nil { fmt.Printf("[build] Using existing artifact at %s\n", artifactPath) } else { - buildVm(artifactDir, artifactPath, cmakeFlags...) + buildVm(artifactPath, cmakeFlags...) } buildArgs := []string{"build"}