7 $pkg_cmd_name = "dart-sass"
9 $pkg_dst_cmd = "$Env:USERPROFILE\.local\opt\dart-sass\sass.bat"
10 $pkg_dst_dir = "$Env:USERPROFILE\.local\opt\dart-sass"
12 #$pkg_dst_cmd = "$Env:USERPROFILE\.local\bin\sass.bat"
13 #$pkg_dst = "$pkg_dst_cmd"
15 $pkg_src_cmd = "$Env:USERPROFILE\.local\opt\dart-sass-v$Env:WEBI_VERSION\sass.bat"
16 $pkg_src_bin = "$Env:USERPROFILE\.local\opt\dart-sass-v$Env:WEBI_VERSION"
17 $pkg_src_dir = "$Env:USERPROFILE\.local\opt\dart-sass-v$Env:WEBI_VERSION"
18 $pkg_src = "$pkg_src_dir"
20 $pkg_download = "$Env:USERPROFILE\Downloads\$Env:WEBI_PKG_FILE"
22 IF (!(Test-Path -Path "$Env:USERPROFILE\Downloads\$Env:WEBI_PKG_FILE"))
24 # TODO: arch detection
25 echo "Downloading sass (dart-sass) from $Env:WEBI_PKG_URL to $pkg_download"
26 & curl.exe -A "$Env:WEBI_UA" -fsSL "$Env:WEBI_PKG_URL" -o "$pkg_download.part"
27 & move "$pkg_download.part" "$pkg_download"
30 IF (!(Test-Path -Path "$pkg_src_cmd"))
32 echo "Installing sass (dart-sass)"
36 # Remove any leftover tmp cruft
37 Remove-Item -Path ".\dart-sass-v*" -Recurse -ErrorAction Ignore
39 echo "Unpacking $pkg_download"
40 & tar xf "$pkg_download"
42 echo "Install Location: $pkg_src_cmd"
43 New-Item "$pkg_src_bin" -ItemType Directory -Force | out-null > $null
44 Move-Item -Path ".\dart-sass\*" -Destination "$pkg_src_dir"
50 Remove-Item "$pkg_dst_dir" -Force -Confirm:$False -Recurse -ErrorAction Ignore
51 echo "Linking '$pkg_dst_dir' from '$pkg_src_dir'"
52 New-Item -ItemType Junction -Path "$pkg_dst_dir" -Target "$pkg_src_dir" > $null
55 & "$Env:USERPROFILE\.local\bin\pathman.exe" add ~/.local/opt/dart-sass