Skip to content

Commit bc052d4

Browse files
committed
changes to wrapper stuff
1 parent d73c219 commit bc052d4

File tree

3 files changed

+53
-14
lines changed

3 files changed

+53
-14
lines changed

.github/workflows/release.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,5 @@ jobs:
3434
aws s3 cp "$file" "s3://releases/mineframe/plugstep/${{ steps.version.outputs.VERSION }}/$(basename $file)" \
3535
--endpoint-url "$R2_ENDPOINT"
3636
done
37+
echo -n "${{ steps.version.outputs.VERSION }}" > latest
38+
aws s3 cp latest "s3://releases/mineframe/plugstep/latest" --endpoint-url "$R2_ENDPOINT"

scripts/install-wrapper.ps1

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,36 @@
11
$ErrorActionPreference = "Stop"
22

33
$WrapperBaseUrl = if ($env:WRAPPER_BASE_URL) { $env:WRAPPER_BASE_URL } else { "https://releases.perny.dev/mineframe/plugstep-wrapper" }
4+
$ReleasesBaseUrl = if ($env:RELEASES_BASE_URL) { $env:RELEASES_BASE_URL } else { "https://releases.perny.dev/mineframe/plugstep" }
45

5-
Write-Host "Installing plugstepw.ps1..."
6+
Write-Host "Installing plugstepw..."
67

8+
# Download bash wrapper
9+
try {
10+
Invoke-WebRequest -Uri "$WrapperBaseUrl/plugstepw" -OutFile "plugstepw" -UseBasicParsing
11+
} catch {
12+
Write-Error "Failed to download bash wrapper: $_"
13+
exit 1
14+
}
15+
16+
# Download PowerShell wrapper
717
try {
818
Invoke-WebRequest -Uri "$WrapperBaseUrl/plugstepw.ps1" -OutFile "plugstepw.ps1" -UseBasicParsing
919
} catch {
10-
Write-Error "Failed to download wrapper: $_"
20+
Write-Error "Failed to download PowerShell wrapper: $_"
21+
exit 1
22+
}
23+
24+
# Fetch and set latest version
25+
Write-Host "Fetching latest version..."
26+
try {
27+
Invoke-WebRequest -Uri "$ReleasesBaseUrl/latest" -OutFile ".plugstep-version" -UseBasicParsing
28+
} catch {
29+
Write-Error "Failed to fetch latest version: $_"
1130
exit 1
1231
}
1332

14-
Write-Host "Installed plugstepw.ps1 to current directory."
15-
Write-Host "Create a .plugstep-version file with your desired version (e.g., v1.0.0)"
33+
$Version = (Get-Content ".plugstep-version" -Raw).Trim()
34+
Write-Host "Installed plugstepw (bash + PowerShell)"
35+
Write-Host "Set version to $Version"
36+
Write-Host "Run .\plugstepw.ps1 to get started"

scripts/install-wrapper.sh

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,35 @@
22
set -euo pipefail
33

44
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}"
56

67
echo "Installing plugstepw..."
78

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+
}
1621

22+
# Download bash wrapper
23+
download "$WRAPPER_BASE_URL/plugstepw" plugstepw
1724
chmod +x plugstepw
1825

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

Comments
 (0)