-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.bash
More file actions
49 lines (33 loc) · 1.12 KB
/
Copy pathinstall.bash
File metadata and controls
49 lines (33 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/usr/bin/env bash
set -e
owner="Kingrashy12"
repo="zio"
asset_name="zio-x86_64-windows.exe"
install_name="zio.exe"
echo "Fetching latest version..."
latest_version=$(curl -s "https://api.github.com/repos/$owner/$repo/releases/latest" \
| grep "tag_name" \
| sed -E 's/.*"tag_name": *"([^"]+)".*/\1/')
echo "Latest version: $latest_version"
download_url="https://github.com/$owner/$repo/releases/download/$latest_version/$asset_name"
echo "Downloading: $download_url"
curl -L -o "$asset_name" "$download_url"
echo "Download complete."
# Determine install directory
# Prefer WindowsApps since it's in PATH by default
install_dir="$LOCALAPPDATA/Microsoft/WindowsApps"
# Fallback if running under WSL
if [ -z "$LOCALAPPDATA" ]; then
install_dir="$HOME/.local/bin"
fi
mkdir -p "$install_dir"
echo "Installing to: $install_dir"
mv -f "$asset_name" "$install_dir/$install_name"
echo "Installed as: $install_dir/$install_name"
echo
# Check if in PATH
if command -v zio >/dev/null 2>&1; then
echo "✅ Installation successful! Run: zio"
else
echo "⚠ Installed, but your PATH may require a terminal restart."
fi