From 73e6da3890fcdeb68dacb57d9e64ca92f2772f71 Mon Sep 17 00:00:00 2001 From: Ken Domino Date: Tue, 28 Jan 2025 21:04:56 -0500 Subject: [PATCH] Fix up global directory with temp variable. --- .github/workflows/main.yml | 6 +++++- _scripts/templates/Antlr4ng/st.build.ps1 | 2 +- _scripts/templates/Antlr4ng/st.build.sh | 2 +- _scripts/templates/CSharp/st.build.ps1 | 2 +- _scripts/templates/CSharp/st.build.sh | 2 +- _scripts/templates/Dart/st.build.ps1 | 2 +- _scripts/templates/Dart/st.build.sh | 2 +- _scripts/templates/Go/st.build.ps1 | 2 +- _scripts/templates/Go/st.build.sh | 2 +- _scripts/templates/Java/st.build.ps1 | 2 +- _scripts/templates/Java/st.build.sh | 2 +- _scripts/templates/JavaScript/st.build.ps1 | 2 +- _scripts/templates/JavaScript/st.build.sh | 2 +- _scripts/templates/PHP/st.build.ps1 | 2 +- _scripts/templates/PHP/st.build.sh | 2 +- _scripts/templates/Python3/st.build.ps1 | 2 +- _scripts/templates/Python3/st.build.sh | 2 +- 17 files changed, 21 insertions(+), 17 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9e91abedce..f291a7737c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -152,7 +152,11 @@ jobs: - name: Install Antlr-ng shell: bash run: | - cd /tmp + if ("${{ matrix.os }}" -eq "windows-latest") { + cd $TEMP + } else { + cd $TMPDIR + } git clone https://github.com/mike-lischke/antlr-ng.git cd antlr-ng git checkout 27676950c547854a62c826345b22b57b8b8c8a98 diff --git a/_scripts/templates/Antlr4ng/st.build.ps1 b/_scripts/templates/Antlr4ng/st.build.ps1 index ad8be28644..26603f95d4 100644 --- a/_scripts/templates/Antlr4ng/st.build.ps1 +++ b/_scripts/templates/Antlr4ng/st.build.ps1 @@ -16,7 +16,7 @@ if($compile_exit_code -ne 0){ $jarFile = Get-ChildItem ./node_modules/antlr4ng-cli/*.jar -Dlanguage=TypeScript } > ; $compile_exit_code = $LASTEXITCODE) | Write-Host +$(& tsx $TEMP$TMPDIR/antlr-ng/cli/runner.ts --encoding -Dlanguage=TypeScript } > ; $compile_exit_code = $LASTEXITCODE) | Write-Host if($compile_exit_code -ne 0){ exit $compile_exit_code \} diff --git a/_scripts/templates/Antlr4ng/st.build.sh b/_scripts/templates/Antlr4ng/st.build.sh index fb3a9b73ce..b340dd7a8b 100644 --- a/_scripts/templates/Antlr4ng/st.build.sh +++ b/_scripts/templates/Antlr4ng/st.build.sh @@ -18,7 +18,7 @@ ls node_modules/.bin find . -name '*.ps1' -Dlanguage=TypeScript } > +tsx $TEMP$TMPDIR/antlr-ng/cli/runner.ts --encoding -Dlanguage=TypeScript } > } > tsc -p tsconfig.json --pretty diff --git a/_scripts/templates/CSharp/st.build.ps1 b/_scripts/templates/CSharp/st.build.ps1 index a557feb92c..9fea8eb8b6 100644 --- a/_scripts/templates/CSharp/st.build.ps1 +++ b/_scripts/templates/CSharp/st.build.ps1 @@ -16,7 +16,7 @@ $version = dotnet trxml2 Other.csproj ` -$(& tsx /tmp/antlr-ng/cli/runner.ts --encoding -Dlanguage=CSharp } > ; $compile_exit_code = $LASTEXITCODE) | Write-Host +$(& tsx $TEMP$TMPDIR/antlr-ng/cli/runner.ts --encoding -Dlanguage=CSharp } > ; $compile_exit_code = $LASTEXITCODE) | Write-Host $(& antlr4 -v $version -encoding -Dlanguage=CSharp } > ; $compile_exit_code = $LASTEXITCODE) | Write-Host diff --git a/_scripts/templates/CSharp/st.build.sh b/_scripts/templates/CSharp/st.build.sh index 6c4c64ff02..c5358a1baa 100644 --- a/_scripts/templates/CSharp/st.build.sh +++ b/_scripts/templates/CSharp/st.build.sh @@ -11,7 +11,7 @@ version=`dotnet trxml2 Other.csproj | fgrep 'PackageReference/@Version' | awk -F -tsx /tmp/antlr-ng/cli/runner.ts --encoding -Dlanguage=CSharp } > +tsx $TEMP$TMPDIR/antlr-ng/cli/runner.ts --encoding -Dlanguage=CSharp } > antlr4 -v $version -encoding -Dlanguage=CSharp } > diff --git a/_scripts/templates/Dart/st.build.ps1 b/_scripts/templates/Dart/st.build.ps1 index 136864b854..91ce4f996d 100644 --- a/_scripts/templates/Dart/st.build.ps1 +++ b/_scripts/templates/Dart/st.build.ps1 @@ -16,7 +16,7 @@ npm i antlr-ng -$(& tsx /tmp/antlr-ng/cli/runner.ts --encoding -Dlanguage=Dart } > ; $compile_exit_code = $LASTEXITCODE) | Write-Host +$(& tsx $TEMP$TMPDIR/antlr-ng/cli/runner.ts --encoding -Dlanguage=Dart } > ; $compile_exit_code = $LASTEXITCODE) | Write-Host $(& antlr4 -v $version -encoding -Dlanguage=Dart } > ; $compile_exit_code = $LASTEXITCODE) | Write-Host diff --git a/_scripts/templates/Dart/st.build.sh b/_scripts/templates/Dart/st.build.sh index 8c965766d9..f5eb6be331 100644 --- a/_scripts/templates/Dart/st.build.sh +++ b/_scripts/templates/Dart/st.build.sh @@ -16,7 +16,7 @@ npm i antlr-ng -tsx /tmp/antlr-ng/cli/runner.ts --encoding -Dlanguage=Dart } > +tsx $TEMP$TMPDIR/antlr-ng/cli/runner.ts --encoding -Dlanguage=Dart } > antlr4 -v $version -encoding -Dlanguage=Dart } > diff --git a/_scripts/templates/Go/st.build.ps1 b/_scripts/templates/Go/st.build.ps1 index f43e3d49f3..8cf73fd2c4 100644 --- a/_scripts/templates/Go/st.build.ps1 +++ b/_scripts/templates/Go/st.build.ps1 @@ -24,7 +24,7 @@ npm i antlr-ng -$(& tsx /tmp/antlr-ng/cli/runner.ts --encoding -Dlanguage=Go } > ; $compile_exit_code = $LASTEXITCODE) | Write-Host +$(& tsx $TEMP$TMPDIR/antlr-ng/cli/runner.ts --encoding -Dlanguage=Go } > ; $compile_exit_code = $LASTEXITCODE) | Write-Host $(& antlr4 -v $version -encoding -Dlanguage=Go } > ; $compile_exit_code = $LASTEXITCODE) | Write-Host diff --git a/_scripts/templates/Go/st.build.sh b/_scripts/templates/Go/st.build.sh index 3c4121cf58..be19b6d0b0 100644 --- a/_scripts/templates/Go/st.build.sh +++ b/_scripts/templates/Go/st.build.sh @@ -21,7 +21,7 @@ npm i antlr-ng -tsx /tmp/antlr-ng/cli/runner.ts --encoding -Dlanguage=Go -o parser -lib parser -package parser } > +tsx $TEMP$TMPDIR/antlr-ng/cli/runner.ts --encoding -Dlanguage=Go -o parser -lib parser -package parser } > antlr4 -v $version -encoding -Dlanguage=Go -o parser -lib parser -package parser } > diff --git a/_scripts/templates/Java/st.build.ps1 b/_scripts/templates/Java/st.build.ps1 index a3745c51b3..cd77c46075 100644 --- a/_scripts/templates/Java/st.build.ps1 +++ b/_scripts/templates/Java/st.build.ps1 @@ -15,7 +15,7 @@ npm i antlr-ng # Download Antlr4 Jar. antlr4 -v $version # Run tool. -$(& tsx /tmp/antlr-ng/cli/runner.ts --encoding -Dlanguage=Java } > ; $compile_exit_code = $LASTEXITCODE) | Write-Host +$(& tsx $TEMP$TMPDIR/antlr-ng/cli/runner.ts --encoding -Dlanguage=Java } > ; $compile_exit_code = $LASTEXITCODE) | Write-Host $(& antlr4 -v $version -encoding -Dlanguage=Java } > ; $compile_exit_code = $LASTEXITCODE) | Write-Host diff --git a/_scripts/templates/Java/st.build.sh b/_scripts/templates/Java/st.build.sh index 54fb1778a1..28b5b8d40c 100644 --- a/_scripts/templates/Java/st.build.sh +++ b/_scripts/templates/Java/st.build.sh @@ -15,7 +15,7 @@ npm i antlr-ng -tsx /tmp/antlr-ng/cli/runner.ts --encoding -Dlanguage=Java } > +tsx $TEMP$TMPDIR/antlr-ng/cli/runner.ts --encoding -Dlanguage=Java } > antlr4 -v $version -encoding -Dlanguage=Java } > diff --git a/_scripts/templates/JavaScript/st.build.ps1 b/_scripts/templates/JavaScript/st.build.ps1 index 31e385a6c0..687f2df7a2 100644 --- a/_scripts/templates/JavaScript/st.build.ps1 +++ b/_scripts/templates/JavaScript/st.build.ps1 @@ -15,7 +15,7 @@ npm i antlr-ng -$(& tsx /tmp/antlr-ng/cli/runner.ts --encoding -Dlanguage=JavaScript } > ; $compile_exit_code = $LASTEXITCODE) | Write-Host +$(& tsx $TEMP$TMPDIR/antlr-ng/cli/runner.ts --encoding -Dlanguage=JavaScript } > ; $compile_exit_code = $LASTEXITCODE) | Write-Host $(& antlr4 -v $version -encoding -Dlanguage=JavaScript } > ; $compile_exit_code = $LASTEXITCODE) | Write-Host diff --git a/_scripts/templates/JavaScript/st.build.sh b/_scripts/templates/JavaScript/st.build.sh index 948c038052..e078a4fdfa 100644 --- a/_scripts/templates/JavaScript/st.build.sh +++ b/_scripts/templates/JavaScript/st.build.sh @@ -15,7 +15,7 @@ npm i antlr-ng -tsx /tmp/antlr-ng/cli/runner.ts --encoding -Dlanguage=JavaScript } > +tsx $TEMP$TMPDIR/antlr-ng/cli/runner.ts --encoding -Dlanguage=JavaScript } > antlr4 -v $version -encoding -Dlanguage=JavaScript } > diff --git a/_scripts/templates/PHP/st.build.ps1 b/_scripts/templates/PHP/st.build.ps1 index 969595bb7e..03d92008cf 100644 --- a/_scripts/templates/PHP/st.build.ps1 +++ b/_scripts/templates/PHP/st.build.ps1 @@ -30,7 +30,7 @@ npm i antlr-ng -$(& tsx /tmp/antlr-ng/cli/runner.ts --encoding -Dlanguage=PHP } > ; $compile_exit_code = $LASTEXITCODE) | Write-Host +$(& tsx $TEMP$TMPDIR/antlr-ng/cli/runner.ts --encoding -Dlanguage=PHP } > ; $compile_exit_code = $LASTEXITCODE) | Write-Host $(& antlr4 -v $version -encoding -Dlanguage=PHP } > ; $compile_exit_code = $LASTEXITCODE) | Write-Host diff --git a/_scripts/templates/PHP/st.build.sh b/_scripts/templates/PHP/st.build.sh index c6683e8857..4956c8d60a 100644 --- a/_scripts/templates/PHP/st.build.sh +++ b/_scripts/templates/PHP/st.build.sh @@ -37,7 +37,7 @@ npm i antlr-ng -tsx /tmp/antlr-ng/cli/runner.ts --encoding -Dlanguage=PHP } > +tsx $TEMP$TMPDIR/antlr-ng/cli/runner.ts --encoding -Dlanguage=PHP } > antlr4 -v $tool_version -encoding -Dlanguage=PHP } > diff --git a/_scripts/templates/Python3/st.build.ps1 b/_scripts/templates/Python3/st.build.ps1 index d9fc729839..f51387ff0b 100644 --- a/_scripts/templates/Python3/st.build.ps1 +++ b/_scripts/templates/Python3/st.build.ps1 @@ -16,7 +16,7 @@ npm i antlr-ng -$(& tsx /tmp/antlr-ng/cli/runner.ts --encoding -Dlanguage=Python3 } > ; $compile_exit_code = $LASTEXITCODE) | Write-Host +$(& tsx $TEMP$TMPDIR/antlr-ng/cli/runner.ts --encoding -Dlanguage=Python3 } > ; $compile_exit_code = $LASTEXITCODE) | Write-Host $(& antlr4 -v $version -encoding -Dlanguage=Python3 } > ; $compile_exit_code = $LASTEXITCODE) | Write-Host diff --git a/_scripts/templates/Python3/st.build.sh b/_scripts/templates/Python3/st.build.sh index 976b96271d..f3f0f70ac1 100644 --- a/_scripts/templates/Python3/st.build.sh +++ b/_scripts/templates/Python3/st.build.sh @@ -16,7 +16,7 @@ npm i antlr-ng -tsx /tmp/antlr-ng/cli/runner.ts --encoding -Dlanguage=Python3 } > +tsx $TEMP$TMPDIR/antlr-ng/cli/runner.ts --encoding -Dlanguage=Python3 } > antlr4 -v $version -encoding -Dlanguage=Python3 } >