From acb4d7cd60777736a6b2c40f61a96a7d8229b3c0 Mon Sep 17 00:00:00 2001 From: "(Holloway) Chew, Kean Ho" Date: Fri, 3 Nov 2023 13:58:13 +0800 Subject: [PATCH] root: tided up homebrew and chocolatey packagers' implementations It seems there were some dirty executions found for homebrew and chocolatey packagers in implementations. Hence, we need to tidy them up for quality assurances. Let's do this. This patch tides up homebrew and chocolatey packagers' implementations in root repository. Co-authored-by: Galyna, Cory <124406765+corygalyna@users.noreply.github.com> Co-authored-by: (Holloway) Chew, Kean Ho Signed-off-by: (Holloway) Chew, Kean Ho --- automataCI/_package-homebrew_windows-any.ps1 | 4 ++-- srcRUST/.ci/_package-chocolatey_unix-any.sh | 8 ++++++-- srcRUST/.ci/_package-chocolatey_windows-any.ps1 | 8 ++++++-- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/automataCI/_package-homebrew_windows-any.ps1 b/automataCI/_package-homebrew_windows-any.ps1 index 5369cf30..dea8b5c9 100644 --- a/automataCI/_package-homebrew_windows-any.ps1 +++ b/automataCI/_package-homebrew_windows-any.ps1 @@ -120,7 +120,7 @@ function PACKAGE-Run-Homebrew { # update the formula.rb script OS-Print-Status info "update given formula.rb file..." - $null = FS-Remove-Silently "${__target_path}.rb" + $null = FS-Remove-Silently "${_target_path}.rb" foreach ($__line in (Get-Content "${_src}\formula.rb")) { $__line = STRINGS-Replace-All ` "${__line}" ` @@ -132,7 +132,7 @@ function PACKAGE-Run-Homebrew { "{{ TARGET_SHASUM }}" ` "${__shasum}" - $__process = FS-Append-File "${__target_path}.rb" "${__line}" + $__process = FS-Append-File "${_target_path}.rb" "${__line}" if ($__process -ne 0) { return 1 } diff --git a/srcRUST/.ci/_package-chocolatey_unix-any.sh b/srcRUST/.ci/_package-chocolatey_unix-any.sh index d7ce9960..b2a28f06 100644 --- a/srcRUST/.ci/_package-chocolatey_unix-any.sh +++ b/srcRUST/.ci/_package-chocolatey_unix-any.sh @@ -202,8 +202,12 @@ if (-not (Test-Path \"\${data_dir}\\\\bin\\\\${PROJECT_SKU}.exe\")) { # Install Write-Host \"assembling workspace for installation...\" -Move-Item -Path \"\${data_dir}\\\\bin\" -Destination \"\${root_dir}\" -Move-Item -Path \"\${data_dir}\\\\lib\" -Destination \"\${root_dir}\" +if (Test-Path -PathType Container -Path \"\${data_dir}\\\\bin\") { + Move-Item -Path \"\${data_dir}\\\\bin\" -Destination \"\${root_dir}\" +} +if (Test-Path -PathType Container -Path \"\${data_dir}\\\\lib\") { + Move-Item -Path \"\${data_dir}\\\\lib\" -Destination \"\${root_dir}\" +} Set-Location \"\$current_dir\" Remove-Item \$data_dir -Force -Recurse -ErrorAction SilentlyContinue " diff --git a/srcRUST/.ci/_package-chocolatey_windows-any.ps1 b/srcRUST/.ci/_package-chocolatey_windows-any.ps1 index 3bc0678c..d497e835 100644 --- a/srcRUST/.ci/_package-chocolatey_windows-any.ps1 +++ b/srcRUST/.ci/_package-chocolatey_windows-any.ps1 @@ -188,8 +188,12 @@ if (-not (Test-Path "`${data_dir}\bin\${env:PROJECT_SKU}.exe")) { Write-Host "assembling workspace for installation..." -Move-Item -Path "`${data_dir}\bin" -Destination "`${root_dir}" -Move-Item -Path "`${data_dir}\lib" -Destination "`${root_dir}" +if (Test-Path -PathType Container -Path "`${data_dir}\bin") { + Move-Item -Path "`${data_dir}\bin" -Destination "`${root_dir}" +} +if (Test-Path -PathType Container -Path "`${data_dir}\lib") { + Move-Item -Path "`${data_dir}\lib" -Destination "`${root_dir}" +} Set-Location "`$current_dir" Remove-Item `$data_dir -Force -Recurse -ErrorAction SilentlyContinue "@