mirror of
https://github.com/webinstall/webi-installers.git
synced 2026-08-19 03:56:16 +00:00
cleanup: use -Force making directories
This commit is contained in:
@@ -34,7 +34,7 @@ IF (!(Test-Path -Path "$pkg_src_cmd"))
|
||||
# Enter tmp
|
||||
pushd .local\tmp
|
||||
|
||||
# Remove any leftover tmp cruft
|
||||
# Remove any leftover tmp cruft
|
||||
Remove-Item -Path ".\foobar-v*" -Recurse -ErrorAction Ignore
|
||||
Remove-Item -Path ".\foo.exe" -Recurse -ErrorAction Ignore
|
||||
|
||||
@@ -46,10 +46,10 @@ IF (!(Test-Path -Path "$pkg_src_cmd"))
|
||||
# Windows BSD-tar handles zip. Imagine that.
|
||||
echo "Unpacking $pkg_download"
|
||||
& tar xf "$pkg_download"
|
||||
|
||||
|
||||
# Settle unpacked archive into place
|
||||
echo "Install Location: $pkg_src_cmd"
|
||||
New-Item "$pkg_src_bin" -ItemType Directory
|
||||
New-Item "$pkg_src_bin" -ItemType Directory -Force
|
||||
Move-Item -Path ".\foobar-*\foo.exe" -Destination "$pkg_src_bin"
|
||||
|
||||
# Exit tmp
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
# Download the latest webi, then install {{ exename }}
|
||||
IF (!(Test-Path -Path .local\bin)) { New-Item -Path .local\bin -ItemType Directory }
|
||||
New-Item -Path .local\bin -ItemType Directory -Force
|
||||
IF ($Env:WEBI_HOST -eq $null -or $Env:WEBI_HOST -eq "") { $Env:WEBI_HOST = "https://webinstall.dev" }
|
||||
curl.exe -s -A "windows" "$Env:WEBI_HOST/packages/_webi/webi.ps1" -o "$Env:USERPROFILE\.local\bin\webi.ps1"
|
||||
Set-ExecutionPolicy -Scope Process Bypass
|
||||
|
||||
+3
-3
@@ -24,15 +24,15 @@ pushd $Env:USERPROFILE
|
||||
# Make paths if needed
|
||||
if (!(Test-Path -Path Downloads))
|
||||
{
|
||||
New-Item -Path Downloads -ItemType Directory
|
||||
New-Item -Path Downloads -ItemType Directory -Force
|
||||
}
|
||||
if (!(Test-Path -Path .local\bin))
|
||||
{
|
||||
New-Item -Path .local\bin -ItemType Directory
|
||||
New-Item -Path .local\bin -ItemType Directory -Force
|
||||
}
|
||||
if (!(Test-Path -Path .local\opt))
|
||||
{
|
||||
New-Item -Path .local\opt -ItemType Directory
|
||||
New-Item -Path .local\opt -ItemType Directory -Force
|
||||
}
|
||||
|
||||
# {{ baseurl }}
|
||||
|
||||
+6
-10
@@ -25,24 +25,20 @@ $exename = $args[0]
|
||||
pushd $Env:USERPROFILE
|
||||
|
||||
# Make paths if needed
|
||||
if (!(Test-Path -Path .local\bin))
|
||||
{
|
||||
New-Item -Path .local\bin -ItemType Directory
|
||||
}
|
||||
if (!(Test-Path -Path .local\xbin))
|
||||
{
|
||||
New-Item -Path .local\xbin -ItemType Directory
|
||||
}
|
||||
New-Item -Path .local\bin -ItemType Directory -Force
|
||||
# TODO replace all xbin with opt\bin\
|
||||
New-Item -Path .local\xbin -ItemType Directory -Force
|
||||
|
||||
# See note on Set-ExecutionPolicy above
|
||||
Set-Content -Path .local\bin\webi.bat -Value "@echo off`r`npushd %USERPROFILE%`r`npowershell -ExecutionPolicy Bypass .local\bin\webi.ps1 %1`r`npopd"
|
||||
if (!(Test-Path -Path .local\opt))
|
||||
{
|
||||
New-Item -Path .local\opt -ItemType Directory
|
||||
New-Item -Path .local\opt -ItemType Directory -Force
|
||||
}
|
||||
# TODO windows version of mktemp -d
|
||||
if (!(Test-Path -Path .local\tmp))
|
||||
{
|
||||
New-Item -Path .local\tmp -ItemType Directory
|
||||
New-Item -Path .local\tmp -ItemType Directory -Force
|
||||
}
|
||||
|
||||
# TODO SetStrictMode
|
||||
|
||||
+1
-1
@@ -45,7 +45,7 @@ IF (!(Test-Path -Path "$pkg_src_cmd"))
|
||||
|
||||
# Settle unpacked archive into place
|
||||
echo "Install Location: $pkg_src_cmd"
|
||||
New-Item "$pkg_src_bin" -ItemType Directory
|
||||
New-Item "$pkg_src_bin" -ItemType Directory -Force
|
||||
Move-Item -Path ".\dotenv.exe" -Destination "$pkg_src_bin"
|
||||
|
||||
# Exit tmp
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@
|
||||
}
|
||||
|
||||
pkg_install() {
|
||||
# $HOME/.local/xbin
|
||||
# $HOME/.local/bin
|
||||
mkdir -p "$pkg_src_bin"
|
||||
|
||||
# mv ./fzf* "$HOME/.local/opt/fzf-v0.21.1/bin/fzf"
|
||||
|
||||
@@ -45,7 +45,7 @@ IF (!(Test-Path -Path "$pkg_src_cmd"))
|
||||
|
||||
# Settle unpacked archive into place
|
||||
echo "Install Location: $pkg_src_cmd"
|
||||
New-Item "$pkg_src_bin" -ItemType Directory
|
||||
New-Item "$pkg_src_bin" -ItemType Directory -Force
|
||||
Move-Item -Path ".\gitdeploy.exe" -Destination "$pkg_src_bin"
|
||||
|
||||
# Exit tmp
|
||||
|
||||
@@ -34,7 +34,7 @@ IF (!(Test-Path -Path "$pkg_src_cmd"))
|
||||
# Enter tmp
|
||||
pushd .local\tmp
|
||||
|
||||
# Remove any leftover tmp cruft
|
||||
# Remove any leftover tmp cruft
|
||||
Remove-Item -Path ".\goreleaser-v*" -Recurse -ErrorAction Ignore
|
||||
Remove-Item -Path ".\goreleaser.exe" -Recurse -ErrorAction Ignore
|
||||
|
||||
@@ -45,7 +45,7 @@ IF (!(Test-Path -Path "$pkg_src_cmd"))
|
||||
|
||||
# Settle unpacked archive into place
|
||||
echo "Install Location: $pkg_src_cmd"
|
||||
New-Item "$pkg_src_bin" -ItemType Directory
|
||||
New-Item "$pkg_src_bin" -ItemType Directory -Force
|
||||
Move-Item -Path ".\goreleaser.exe" -Destination "$pkg_src_bin"
|
||||
|
||||
# Exit tmp
|
||||
|
||||
@@ -45,7 +45,7 @@ IF (!(Test-Path -Path "$pkg_src_cmd"))
|
||||
|
||||
# Settle unpacked archive into place
|
||||
echo "Install Location: $pkg_src_cmd"
|
||||
New-Item "$pkg_src_bin" -ItemType Directory
|
||||
New-Item "$pkg_src_bin" -ItemType Directory -Force
|
||||
Move-Item -Path ".\keypairs.exe" -Destination "$pkg_src_bin"
|
||||
|
||||
# Exit tmp
|
||||
|
||||
@@ -34,16 +34,16 @@ IF (!(Test-Path -Path "$pkg_src_cmd"))
|
||||
# Enter tmp
|
||||
pushd .local\tmp
|
||||
|
||||
# Remove any leftover tmp cruft
|
||||
# Remove any leftover tmp cruft
|
||||
Remove-Item -Path ".\watchexec-v*" -Recurse -ErrorAction Ignore
|
||||
Remove-Item -Path ".\watchexec.exe" -Recurse -ErrorAction Ignore
|
||||
|
||||
echo "Unpacking $pkg_download"
|
||||
& tar xf "$pkg_download"
|
||||
|
||||
|
||||
# Settle unpacked archive into place
|
||||
echo "Install Location: $pkg_src_cmd"
|
||||
New-Item "$pkg_src_bin" -ItemType Directory
|
||||
New-Item "$pkg_src_bin" -ItemType Directory -Force
|
||||
Move-Item -Path ".\watchexec-*\watchexec.exe" -Destination "$pkg_src_bin"
|
||||
|
||||
# Exit tmp
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
#!/usr/bin/env pwsh
|
||||
|
||||
curl.exe -s "https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi" -o "$Env:USERPROFILE\Downloads\wsl_update_x64.msi"
|
||||
msiexec /a "$Env:USERPROFILE\Downloads\wsl_update_x64.msi" /qb TARGETDIR="C:\temp"
|
||||
copy C:\temp\System32\lxss\tools\kernel C:\Windows\System32\lxss\tools\
|
||||
|
||||
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
|
||||
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
|
||||
|
||||
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
|
||||
|
||||
wsl --set-default-version 2
|
||||
|
||||
# TODO
|
||||
#Set-VMProcessor -VMName <VMName> -ExposeVirtualizationExtensions $true
|
||||
Reference in New Issue
Block a user