|
2 | 2 | set -euo pipefail |
3 | 3 |
|
4 | 4 | WRAPPER_BASE_URL="${WRAPPER_BASE_URL:-https://releases.perny.dev/mineframe/plugstep-wrapper}" |
| 5 | +RELEASES_BASE_URL="${RELEASES_BASE_URL:-https://releases.perny.dev/mineframe/plugstep}" |
5 | 6 |
|
6 | 7 | echo "Installing plugstepw..." |
7 | 8 |
|
8 | | -if command -v curl &> /dev/null; then |
9 | | - curl -fSL "$WRAPPER_BASE_URL/plugstepw" -o plugstepw |
10 | | -elif command -v wget &> /dev/null; then |
11 | | - wget -q "$WRAPPER_BASE_URL/plugstepw" -O plugstepw |
12 | | -else |
13 | | - echo "Error: curl or wget required" >&2 |
14 | | - exit 1 |
15 | | -fi |
| 9 | +download() { |
| 10 | + local url="$1" |
| 11 | + local output="$2" |
| 12 | + if command -v curl &> /dev/null; then |
| 13 | + curl -fSL "$url" -o "$output" |
| 14 | + elif command -v wget &> /dev/null; then |
| 15 | + wget -q "$url" -O "$output" |
| 16 | + else |
| 17 | + echo "Error: curl or wget required" >&2 |
| 18 | + exit 1 |
| 19 | + fi |
| 20 | +} |
16 | 21 |
|
| 22 | +# Download bash wrapper |
| 23 | +download "$WRAPPER_BASE_URL/plugstepw" plugstepw |
17 | 24 | chmod +x plugstepw |
18 | 25 |
|
19 | | -echo "Installed plugstepw to current directory." |
20 | | -echo "Create a .plugstep-version file with your desired version (e.g., v1.0.0)" |
| 26 | +# Download PowerShell wrapper |
| 27 | +download "$WRAPPER_BASE_URL/plugstepw.ps1" plugstepw.ps1 |
| 28 | + |
| 29 | +# Fetch and set latest version |
| 30 | +echo "Fetching latest version..." |
| 31 | +download "$RELEASES_BASE_URL/latest" .plugstep-version |
| 32 | + |
| 33 | +VERSION=$(cat .plugstep-version) |
| 34 | +echo "Installed plugstepw (bash + PowerShell)" |
| 35 | +echo "Set version to $VERSION" |
| 36 | +echo "Run ./plugstepw to get started" |
0 commit comments