From: AJ ONeal Date: Thu, 11 Feb 2021 21:37:26 +0000 (+0000) Subject: sass updates for Windows X-Git-Url: https://git.josue.xyz/?a=commitdiff_plain;h=2ff0fc638bfe4e71aac1d04c84430da8d0706ce7;p=webi-installers%2F.git sass updates for Windows --- diff --git a/sass/install.ps1 b/sass/install.ps1 index 434eede..bd9fd35 100644 --- a/sass/install.ps1 +++ b/sass/install.ps1 @@ -6,45 +6,50 @@ $pkg_cmd_name = "dart-sass" -$pkg_dst_cmd = "$Env:USERPROFILE\.local\bin\dart-sass.exe" -$pkg_dst = "$pkg_dst_cmd" - -$pkg_src_cmd = "$Env:USERPROFILE\.local\opt\dart-sass-v$Env:WEBI_VERSION\bin\dart-sass.exe" -$pkg_src_bin = "$Env:USERPROFILE\.local\opt\dart-sass-v$Env:WEBI_VERSION\bin" +$pkg_dst_cmd = "$Env:USERPROFILE\.local\opt\dart-sass\sass.bat" +$pkg_dst_dir = "$Env:USERPROFILE\.local\opt\dart-sass" +$pkg_dst = "$pkg_dst" +#$pkg_dst_cmd = "$Env:USERPROFILE\.local\bin\sass.bat" +#$pkg_dst = "$pkg_dst_cmd" + +$pkg_src_cmd = "$Env:USERPROFILE\.local\opt\dart-sass-v$Env:WEBI_VERSION\sass.bat" +$pkg_src_bin = "$Env:USERPROFILE\.local\opt\dart-sass-v$Env:WEBI_VERSION" $pkg_src_dir = "$Env:USERPROFILE\.local\opt\dart-sass-v$Env:WEBI_VERSION" -$pkg_src = "$pkg_src_cmd" +$pkg_src = "$pkg_src_dir" $pkg_download = "$Env:USERPROFILE\Downloads\$Env:WEBI_PKG_FILE" IF (!(Test-Path -Path "$Env:USERPROFILE\Downloads\$Env:WEBI_PKG_FILE")) { # TODO: arch detection - echo "Downloading dart-sass from $Env:WEBI_PKG_URL to $pkg_download" + echo "Downloading sass (dart-sass) from $Env:WEBI_PKG_URL to $pkg_download" & curl.exe -A "$Env:WEBI_UA" -fsSL "$Env:WEBI_PKG_URL" -o "$pkg_download.part" & move "$pkg_download.part" "$pkg_download" } IF (!(Test-Path -Path "$pkg_src_cmd")) { - echo "Installing dart-sass" + echo "Installing sass (dart-sass)" pushd .local\tmp # Remove any leftover tmp cruft Remove-Item -Path ".\dart-sass-v*" -Recurse -ErrorAction Ignore - Remove-Item -Path ".\dart-sass.exe" -Recurse -ErrorAction Ignore echo "Unpacking $pkg_download" & tar xf "$pkg_download" echo "Install Location: $pkg_src_cmd" - New-Item "$pkg_src_bin" -ItemType Directory -Force - Move-Item -Path ".\dart-sass-*\dart-sass.exe" -Destination "$pkg_src_bin" + New-Item "$pkg_src_bin" -ItemType Directory -Force > $null + Move-Item -Path ".\dart-sass\*" -Destination "$pkg_src_dir" # Exit tmp popd } -echo "Copying into '$pkg_dst_cmd' from '$pkg_src_cmd'" -Remove-Item -Path "$pkg_dst_cmd" -Recurse -ErrorAction Ignore -Copy-Item -Path "$pkg_src" -Destination "$pkg_dst" -Recurse +Remove-Item "$pkg_dst_dir" -Force -Confirm:$False -Recurse -ErrorAction Ignore +echo "Linking '$pkg_dst_dir' from '$pkg_src_dir'" +New-Item -ItemType Junction -Path "$pkg_dst_dir" -Target "$pkg_src_dir" > $null + +# Add to path +& "$Env:USERPROFILE\.local\bin\pathman.exe" add ~/.local/opt/dart-sass