From 6d2c6434d3e338f2fe02dfb22277a1e06fb6c71d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Eriksson?= Date: Sun, 22 Dec 2024 16:26:05 +0100 Subject: [PATCH] install local encore.dev in dev mode --- cli/cmd/encore/app/create.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/cli/cmd/encore/app/create.go b/cli/cmd/encore/app/create.go index e3de91f8be..fde14e0f76 100644 --- a/cli/cmd/encore/app/create.go +++ b/cli/cmd/encore/app/create.go @@ -391,17 +391,19 @@ func gogetEncore(dir string) error { } func npmInstallEncore(dir string) error { - verToInstall := version.Version + args := []string{"install"} if version.Channel == version.DevBuild { - verToInstall = "latest" + args = append(args, filepath.Join(env.EncoreRuntimesPath(), "js", "encore.dev")) + } else { + args = append(args, fmt.Sprintf("encore.dev@%s", version.Version)) } // First install the 'encore.dev' package. - cmd := exec.Command("npm", "install", fmt.Sprintf("encore.dev@%s", verToInstall)) + cmd := exec.Command("npm", args...) cmd.Dir = dir out, err := cmd.CombinedOutput() if err != nil { - err = fmt.Errorf("'npm install encore.dev@%s' failed: %v: %s", verToInstall, err, out) + err = fmt.Errorf("installing encore.dev package failed: %v: %s", err, out) } // Then run 'npm install'.