aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2020-11-20 03:44:01 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2020-11-20 03:52:24 +0300
commitb119cf19328615e1589728659f509a00d55c1bc4 (patch)
tree80b86ed307954a21033c03696a68515cc7819317
parentREADME: update (diff)
downloadvs-shell-b119cf19328615e1589728659f509a00d55c1bc4.tar.gz
vs-shell-b119cf19328615e1589728659f509a00d55c1bc4.zip
show the faulty JSON from VsDevCmd.bat
For some reason, VS 2017 started failing. I couldn't find why, it magically fixed itself when I started logging the JSON in case parsing fails.
Diffstat (limited to '')
-rw-r--r--action.yml11
1 files changed, 7 insertions, 4 deletions
diff --git a/action.yml b/action.yml
index ffc04bf..afadbf7 100644
--- a/action.yml
+++ b/action.yml
@@ -76,13 +76,16 @@ runs:
throw "Couldn't find script '$script_name'"
}
- $json = $(& "${env:COMSPEC}" /s /c "`"$script_path`" -arch=${{ inputs.arch }} -no_logo && pwsh -Command `"Get-ChildItem env: | ConvertTo-Json`"")
+ $json = $(& "${env:COMSPEC}" /s /c "`"$script_path`" -arch=${{ inputs.arch }} -no_logo && pwsh -Command `"Get-ChildItem env: | Select-Object Name,Value | ConvertTo-Json`"")
if ($LASTEXITCODE -ne 0) {
throw $json
} else {
- $json | ConvertFrom-Json | %{
- $k, $v = $_.Key, $_.Value
- Set-Content "env:$k" "$v"
+ try {
+ $json | ConvertFrom-Json | %{ Set-Content "env:$($_.Name)" $_.Value }
+ } catch {
+ echo 'There was a problem with the following JSON:'
+ echo $json
+ throw
}
}
}