]> granicus.if.org Git - graphviz/commitdiff
Windows: remove usage of 'sed' in setup-build-utilities script
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 20 Feb 2022 23:03:55 +0000 (15:03 -0800)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Wed, 23 Feb 2022 03:24:08 +0000 (19:24 -0800)
This results in `$PATH` potentially having duplicated trailing entries, but this
causes no harm and preventing it does not seem worth a `sed` dependency.

Gitlab: #2115

windows/bin/setup-build-utilities.ps1

index 8a83533c8d3c944074db9866e123667a051249e6..11fb02bbbe9862b2fc56aad3ed9e2a09c828dce9 100644 (file)
@@ -57,8 +57,6 @@ find_or_fallback "msbuild" "$MSBUILD_BIN"
 
 if (-NOT (cpack.exe --help | Select-String 'CPACK_GENERATOR')) {
     echo "Moving $CMAKE_BIN to front of PATH in order to find CMake's cpack"
-    $CMAKE_BIN_ESCAPED = echo $CMAKE_BIN | sed 's#\\#\\\\#g'
-    $path = (Invoke-Expression 'echo $Env:Path' | sed "s#;$CMAKE_BIN_ESCAPED##")
     $Env:Path="$CMAKE_BIN;$path"
 }
 
@@ -66,8 +64,7 @@ $ErrorActionPreference = "Continue"
 if (-NOT (sort.exe /? 2>$null | Select-String "SORT")) {
     $ErrorActionPreference = "Stop"
     echo "Moving C:\WINDOWS\system32 to front of PATH in order to find Windows' sort"
-    $path = (Invoke-Expression 'echo $Env:Path' | sed 's#;C:\\WINDOWS\\system32;#;#')
-    $Env:Path="C:\WINDOWS\system32;$path"
+    $Env:Path="C:\WINDOWS\system32;$Env:Path"
 }
 $ErrorActionPreference = "Stop"