mirror of
https://github.com/PR0M3TH3AN/VoxVera.git
synced 2025-09-09 15:38:43 +00:00
Merge pull request #45 from PR0M3TH3AN/codex/wrap-pipx-install-in-install.sh-and-install.ps1
Add fallback on pipx failure
This commit is contained in:
10
install.ps1
10
install.ps1
@@ -24,7 +24,15 @@ if ($choco) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (Get-Command pipx -ErrorAction SilentlyContinue) {
|
if (Get-Command pipx -ErrorAction SilentlyContinue) {
|
||||||
pipx install voxvera --force
|
try {
|
||||||
|
pipx install voxvera --force
|
||||||
|
} catch {
|
||||||
|
Write-Host 'pipx install failed, downloading binary'
|
||||||
|
$dest = "$HOME/.local/bin"
|
||||||
|
New-Item -ItemType Directory -Path $dest -Force | Out-Null
|
||||||
|
$url = 'https://github.com/PR0M3TH3AN/VoxVera/releases/latest/download/voxvera.exe'
|
||||||
|
Invoke-WebRequest -Uri $url -OutFile "$dest/voxvera.exe"
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
$dest = "$HOME/.local/bin"
|
$dest = "$HOME/.local/bin"
|
||||||
New-Item -ItemType Directory -Path $dest -Force | Out-Null
|
New-Item -ItemType Directory -Path $dest -Force | Out-Null
|
||||||
|
17
install.sh
17
install.sh
@@ -62,7 +62,22 @@ require_pkg qrencode qrencode
|
|||||||
require_pkg convert imagemagick
|
require_pkg convert imagemagick
|
||||||
|
|
||||||
if command_exists pipx; then
|
if command_exists pipx; then
|
||||||
pipx install --force voxvera
|
if ! pipx install --force voxvera; then
|
||||||
|
echo "pipx install failed, downloading binary"
|
||||||
|
install_dir="$HOME/.local/bin"
|
||||||
|
mkdir -p "$install_dir"
|
||||||
|
url="https://github.com/PR0M3TH3AN/VoxVera/releases/latest/download/voxvera"
|
||||||
|
dest="$install_dir/voxvera"
|
||||||
|
if command_exists curl; then
|
||||||
|
curl -fsSL "$url" -o "$dest"
|
||||||
|
elif command_exists wget; then
|
||||||
|
wget -q "$url" -O "$dest"
|
||||||
|
else
|
||||||
|
echo "Install curl or wget to download voxvera" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
chmod +x "$dest"
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
install_dir="$HOME/.local/bin"
|
install_dir="$HOME/.local/bin"
|
||||||
mkdir -p "$install_dir"
|
mkdir -p "$install_dir"
|
||||||
|
Reference in New Issue
Block a user