From 20543281bc11b4a5cf48ff9eefabb65061b68272 Mon Sep 17 00:00:00 2001 From: Justin Blake Date: Thu, 30 Jan 2025 07:15:58 -0500 Subject: [PATCH] Fix backend command on windows Quote escaping discrepencies across mac/linux and windows without this. Fixes https://github.com/gren-lang/compiler/issues/276 --- src/Compiler/Backend.gren | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/Compiler/Backend.gren b/src/Compiler/Backend.gren index a696523..1a69e42 100644 --- a/src/Compiler/Backend.gren +++ b/src/Compiler/Backend.gren @@ -36,7 +36,7 @@ import FileSystem.Path as Path exposing (Path) import Compiler.PackageName as PackageName exposing (PackageName) import Compiler.Platform as Platform exposing (Platform) import SemanticVersion exposing (SemanticVersion) -import ChildProcess +import ChildProcess exposing (Shell(..)) import Json.Encode as Json import Dict exposing (Dict) import Task exposing (Task) @@ -272,9 +272,6 @@ run permission options = |> commandEncoder options.interactiveSession options.pathToString |> Json.encode 0 - escapedCommand = - "'" ++ commandAsJson ++ "'" - colorEnvVar = if options.useColor then Dict.singleton "FORCE_COLOR" "1" @@ -284,9 +281,10 @@ run permission options = ChildProcess.spawn permission (options.pathToString options.compilerPath) - [ escapedCommand ] + [ commandAsJson ] { ( ChildProcess.defaultSpawnOptions options.onInit options.onComplete ) - | environmentVariables = + | shell = NoShell + , environmentVariables = ChildProcess.MergeWithEnvironmentVariables colorEnvVar }