Skip to content

Commit

Permalink
powershell and powershell_core: Fix shellcheck complaints.
Browse files Browse the repository at this point in the history
  • Loading branch information
ProjectSynchro committed Aug 9, 2024
1 parent 5e61e99 commit efa0126
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/winetricks
Original file line number Diff line number Diff line change
Expand Up @@ -12423,19 +12423,19 @@ w_metadata powershell_core dlls \

load_powershell_core()
{
# shellcheck disable=SC2154
# Disable SC2154 due to shellcheck not knowing metadata is sourced before this function is run

# Uncomment below and remove win32 download elif and file when PowerShell Core v7.2 LTS goes EOL
#w_package_unsupported_win32

# Download PowerShell Core 7.2.x MSI (Latest LTS Version to support win32)
# https://github.com/PowerShell/PowerShell/releases/v7.2.21
if [ "${W_ARCH}" = "win64" ]; then
w_download "https://github.com/PowerShell/PowerShell/releases/download/v7.2.21/PowerShell-7.2.21-win-x64.msi" 407640b11c89d66ec7892229e68b1d74b26f0e820b52da268c67fd166c2b46ad
# Disable SC2154 due to shellcheck not knowing metadata is sourced before this function is run
# shellcheck disable=SC2154
msi="${file2}"
elif [ "${W_ARCH}" = "win32" ]; then
w_download "https://github.com/PowerShell/PowerShell/releases/download/v7.2.21/PowerShell-7.2.21-win-x86.msi" cdfd69f6997eabe5abdc38869eedfd90761416261bf95531300f652d0932bf0a
# shellcheck disable=SC2154
msi="${file1}"
fi

Expand All @@ -12459,9 +12459,6 @@ w_metadata powershell dlls \

load_powershell()
{
# shellcheck disable=SC2154
# Disable SC2154 due to shellcheck not knowing metadata is sourced before this function is run

w_do_call powershell_core

# Download PowerShell Wrapper 32bit exe
Expand All @@ -12479,15 +12476,21 @@ load_powershell()
w_try_cd "${W_CACHE}/${W_PACKAGE}"

# Install PWSH Wrapper

# Disable SC2154 due to shellcheck not knowing metadata is sourced before this function is run
# shellcheck disable=SC2154
w_try_cp_dll "${file1}" "${W_SYSTEM32_DLLS}/WindowsPowerShell/v1.0/powershell.exe"
if [ "${W_ARCH}" = "win64" ]; then
# shellcheck disable=SC2154
w_try_cp_dll "${file2}" "${W_SYSTEM64_DLLS}/WindowsPowerShell/v1.0/powershell.exe"
fi

# Install profile.ps1 for wrapper
if [ "${W_ARCH}" = "win64" ]; then
# shellcheck disable=SC2154
w_try cp "${file3}" "${W_PROGRAMW6432_UNIX}/PowerShell/7/${file3}"
else
# shellcheck disable=SC2154
w_try cp "${file3}" "${W_PROGRAMS_UNIX}/PowerShell/7/${file3}"
fi

Expand Down

0 comments on commit efa0126

Please sign in to comment.