From 97a43449aad9e37ead9fcdfd56700cf412925e5a Mon Sep 17 00:00:00 2001 From: Zijian Date: Sat, 5 Oct 2024 15:09:56 +1000 Subject: [PATCH] refactoring --- BuildRelease.ps1 | 2 +- CreateDebugWebClientApi.ps1 | 2 +- CreateDemoCoreWebClientApi.ps1 | 2 +- CreateDemoGodAssemblyWebClientApi.ps1 | 2 +- CreateDemoTextJsonWebClientApi.ps1 | 2 +- DotNetPack.ps1 | 2 +- HeroesDemo/buildDev.ps1 | 2 +- HeroesDemo/buildProd.ps1 | 2 +- HeroesDemo/runtest.ps1 | 2 +- HeroesDemo/startDev.ps1 | 2 +- HeroesDemo/startProd.ps1 | 2 +- StartDemoCoreWeb.ps1 | 2 +- StartDemoTextJsonWeb.ps1 | 2 +- StartGodAssembly.ps1 | 2 +- TestReleaseAll.ps1 | 2 +- aurelia/runtest.ps1 | 2 +- axios/runtest.ps1 | 2 +- buildJqTests.ps1 | 2 +- fetchapi/runtest.ps1 | 2 +- 19 files changed, 19 insertions(+), 19 deletions(-) diff --git a/BuildRelease.ps1 b/BuildRelease.ps1 index c9f59288..35ba4dc2 100644 --- a/BuildRelease.ps1 +++ b/BuildRelease.ps1 @@ -1,2 +1,2 @@ -cd $PSScriptRoot +Set-Location $PSScriptRoot dotnet build webapiclientgen.sln --configuration Release --no-incremental \ No newline at end of file diff --git a/CreateDebugWebClientApi.ps1 b/CreateDebugWebClientApi.ps1 index c4b9b4b1..a5661f2a 100644 --- a/CreateDebugWebClientApi.ps1 +++ b/CreateDebugWebClientApi.ps1 @@ -1,4 +1,4 @@ -cd $PSScriptRoot +Set-Location $PSScriptRoot #Make sure CodeGen.json is saved in format ANSI or UTF-8 without BOM, since ASP.NET Core 2.0 Web API will fail to deserialize POST Body that contains BOM. #Step 1: Launch Website $path = "$PSScriptRoot/DebugWeb" diff --git a/CreateDemoCoreWebClientApi.ps1 b/CreateDemoCoreWebClientApi.ps1 index 14b36412..ecf1bb2c 100644 --- a/CreateDemoCoreWebClientApi.ps1 +++ b/CreateDemoCoreWebClientApi.ps1 @@ -1,4 +1,4 @@ -cd $PSScriptRoot +Set-Location $PSScriptRoot #Make sure CodeGen.json is saved in format ANSI or UTF-8 without BOM, since ASP.NET Core 2.0 Web API will fail to deserialize POST Body that contains BOM. # Step 3 and 4 may be optional #Step 1: Launch Website diff --git a/CreateDemoGodAssemblyWebClientApi.ps1 b/CreateDemoGodAssemblyWebClientApi.ps1 index bc1fd8e5..1d4c9afb 100644 --- a/CreateDemoGodAssemblyWebClientApi.ps1 +++ b/CreateDemoGodAssemblyWebClientApi.ps1 @@ -1,4 +1,4 @@ -cd $PSScriptRoot +Set-Location $PSScriptRoot #Make sure CodeGen.json is saved in format ANSI or UTF-8 without BOM, since ASP.NET Core 2.0 Web API will fail to deserialize POST Body that contains BOM. #Step 1: Launch Website $path = "$PSScriptRoot/DemoGodAssemblyWeb" diff --git a/CreateDemoTextJsonWebClientApi.ps1 b/CreateDemoTextJsonWebClientApi.ps1 index bba98ed3..1514ca65 100644 --- a/CreateDemoTextJsonWebClientApi.ps1 +++ b/CreateDemoTextJsonWebClientApi.ps1 @@ -1,4 +1,4 @@ -cd $PSScriptRoot +Set-Location $PSScriptRoot #Make sure CodeGen.json is saved in format ANSI or UTF-8 without BOM, since ASP.NET Core 2.0 Web API will fail to deserialize POST Body that contains BOM. # Step 3 may be optional #Step 1: Launch Website diff --git a/DotNetPack.ps1 b/DotNetPack.ps1 index 99a1e678..d5132ddf 100644 --- a/DotNetPack.ps1 +++ b/DotNetPack.ps1 @@ -1,5 +1,5 @@ # pack existing release build -cd $PSScriptRoot +Set-Location $PSScriptRoot $packCmd = 'dotnet pack $Name --no-build --output Release --configuration Release' $projList = 'Fonlow.Poco2TsCore/Fonlow.Poco2TsCore.csproj', 'Fonlow.DocCommentCore/Fonlow.DocCommentCore.csproj', 'Fonlow.Web.MetaCore/Fonlow.Web.MetaCore.csproj', 'WebApiClientGenCore.Abstract/WebApiClientGenCore.Abstract.csproj', 'WebApiClientGenCore/WebApiClientGenCore.csproj', 'WebApiClientGenCore.NG2/WebApiClientGenCore.NG2.csproj', 'WebApiClientGenCore.NG2FormGroup/WebApiClientGenCore.NG2FormGroup.csproj', 'WebApiClientGenCore.Aurelia/WebApiClientGenCore.Aurelia.csproj', 'WebApiClientGenCore.Axios/WebApiClientGenCore.Axios.csproj', 'WebApiClientGenCore.Fetch/WebApiClientGenCore.Fetch.csproj', 'WebApiClientGenCore.jQuery/WebApiClientGenCore.jQuery.csproj', 'Fonlow.DateOnlyExtensions/Fonlow.DateOnlyExtensions.csproj', 'Fonlow.DateOnlyExtensionsNet/Fonlow.DateOnlyExtensionsTextJson.csproj', 'Fonlow.IntegralExtension/Fonlow.IntegralExtensions.csproj', 'Fonlow.IntegralExtensionsTextJson/Fonlow.IntegralExtensionsTextJson.csproj' foreach($name in $projList){ diff --git a/HeroesDemo/buildDev.ps1 b/HeroesDemo/buildDev.ps1 index e57c717a..de90a9f3 100644 --- a/HeroesDemo/buildDev.ps1 +++ b/HeroesDemo/buildDev.ps1 @@ -1,2 +1,2 @@ -cd $PSScriptRoot +Set-Location $PSScriptRoot ng build --configuration=dev \ No newline at end of file diff --git a/HeroesDemo/buildProd.ps1 b/HeroesDemo/buildProd.ps1 index 929560f6..993c67dd 100644 --- a/HeroesDemo/buildProd.ps1 +++ b/HeroesDemo/buildProd.ps1 @@ -1,2 +1,2 @@ -cd $PSScriptRoot +Set-Location $PSScriptRoot ng build --configuration=production \ No newline at end of file diff --git a/HeroesDemo/runtest.ps1 b/HeroesDemo/runtest.ps1 index 3883da27..a226c7a4 100644 --- a/HeroesDemo/runtest.ps1 +++ b/HeroesDemo/runtest.ps1 @@ -1,2 +1,2 @@ -cd $PSScriptRoot +Set-Location $PSScriptRoot ng test \ No newline at end of file diff --git a/HeroesDemo/startDev.ps1 b/HeroesDemo/startDev.ps1 index 43d0bb4c..03c83902 100644 --- a/HeroesDemo/startDev.ps1 +++ b/HeroesDemo/startDev.ps1 @@ -1,3 +1,3 @@ #Run prod build with dotnet hosting -cd $PSScriptRoot +Set-Location $PSScriptRoot dotnet-serve -d ../ngdist/dev -p 5200 diff --git a/HeroesDemo/startProd.ps1 b/HeroesDemo/startProd.ps1 index 7b09e5d3..45f91bd8 100644 --- a/HeroesDemo/startProd.ps1 +++ b/HeroesDemo/startProd.ps1 @@ -1,3 +1,3 @@ #Run prod build with dotnet hosting -cd $PSScriptRoot +Set-Location $PSScriptRoot dotnet-serve -d ../ngdist/prod -p 5200 diff --git a/StartDemoCoreWeb.ps1 b/StartDemoCoreWeb.ps1 index 607fb61c..ae2a062e 100644 --- a/StartDemoCoreWeb.ps1 +++ b/StartDemoCoreWeb.ps1 @@ -1,5 +1,5 @@ #Launch WebApi Website and POST a request for generating client APIs -cd $PSScriptRoot +Set-Location $PSScriptRoot $path = "$PSScriptRoot/DemoCoreWeb/bin/Debug/net8.0" $procArgs = @{ FilePath = "dotnet.exe" diff --git a/StartDemoTextJsonWeb.ps1 b/StartDemoTextJsonWeb.ps1 index 9f67d7b4..344b067e 100644 --- a/StartDemoTextJsonWeb.ps1 +++ b/StartDemoTextJsonWeb.ps1 @@ -1,5 +1,5 @@ #Launch WebApi Website and POST a request for generating client APIs -cd $PSScriptRoot +Set-Location $PSScriptRoot $path = "$PSScriptRoot/DemoTextJsonWeb" $procArgs = @{ FilePath = "dotnet.exe" diff --git a/StartGodAssembly.ps1 b/StartGodAssembly.ps1 index 1f0939e3..da01034c 100644 --- a/StartGodAssembly.ps1 +++ b/StartGodAssembly.ps1 @@ -1,5 +1,5 @@ #Launch WebApi Website and POST a request for generating client APIs -cd $PSScriptRoot +Set-Location $PSScriptRoot $path = "$PSScriptRoot/DemoGodAssemblyWeb" $procArgs = @{ FilePath = "dotnet.exe" diff --git a/TestReleaseAll.ps1 b/TestReleaseAll.ps1 index 9faff310..6d58780a 100644 --- a/TestReleaseAll.ps1 +++ b/TestReleaseAll.ps1 @@ -1,2 +1,2 @@ -cd $PSScriptRoot +Set-Location $PSScriptRoot dotnet test --verbosity normal --configuration Release --no-build \ No newline at end of file diff --git a/aurelia/runtest.ps1 b/aurelia/runtest.ps1 index b7380761..e3a9de9e 100644 --- a/aurelia/runtest.ps1 +++ b/aurelia/runtest.ps1 @@ -1,2 +1,2 @@ -cd $PSScriptRoot +Set-Location $PSScriptRoot karma start ./karma.conf.js \ No newline at end of file diff --git a/axios/runtest.ps1 b/axios/runtest.ps1 index 4f60dff5..b6ffb8fb 100644 --- a/axios/runtest.ps1 +++ b/axios/runtest.ps1 @@ -1,2 +1,2 @@ -cd $PSScriptRoot +Set-Location $PSScriptRoot npx jest \ No newline at end of file diff --git a/buildJqTests.ps1 b/buildJqTests.ps1 index 6c27c5a1..e9f44c76 100644 --- a/buildJqTests.ps1 +++ b/buildJqTests.ps1 @@ -1,4 +1,4 @@ -cd $PSScriptRoot +Set-Location $PSScriptRoot #Step 3: Compile generated TS codes to JS for jQuery. https://www.typescriptlang.org/docs/handbook/compiler-options.html # make sure TS compiler is installed through npm install -g typescript, then tsc.ps1 is available in C:\Users\YourProfile\AppData\Roaming\npm diff --git a/fetchapi/runtest.ps1 b/fetchapi/runtest.ps1 index 4f60dff5..b6ffb8fb 100644 --- a/fetchapi/runtest.ps1 +++ b/fetchapi/runtest.ps1 @@ -1,2 +1,2 @@ -cd $PSScriptRoot +Set-Location $PSScriptRoot npx jest \ No newline at end of file