Skip to content

Commit 24f61d2

Browse files
committed
Remove nightly installer path
1 parent ffc258e commit 24f61d2

File tree

4 files changed

+15
-158
lines changed

4 files changed

+15
-158
lines changed

.github/workflows/nightly.yml

Lines changed: 0 additions & 109 deletions
This file was deleted.

README.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ curl -fsSL https://raw.githubusercontent.com/ph8n/nytgames-cli/main/scripts/inst
2626
Options:
2727
- Pin a version:
2828
- `curl -fsSL https://raw.githubusercontent.com/ph8n/nytgames-cli/main/scripts/install.sh | NYTGAMES_CLI_VERSION=X.Y.Z bash`
29-
- Install latest main build (CI):
30-
- `curl -fsSL https://raw.githubusercontent.com/ph8n/nytgames-cli/main/scripts/install.sh | NYTGAMES_CLI_CHANNEL=main bash`
3129
- Choose install dir: `NYTGAMES_CLI_INSTALL_DIR=~/.local/bin`
3230

3331
### One-line installer (Windows PowerShell)
@@ -43,8 +41,6 @@ Windows builds are currently x64 only.
4341
Options:
4442
- Pin a version:
4543
- `$env:NYTGAMES_CLI_VERSION="X.Y.Z"; curl.exe -fsSL https://raw.githubusercontent.com/ph8n/nytgames-cli/main/scripts/install.ps1 | powershell -NoProfile -ExecutionPolicy Bypass -Command -`
46-
- Install latest main build (CI):
47-
- `$env:NYTGAMES_CLI_CHANNEL="main"; curl.exe -fsSL https://raw.githubusercontent.com/ph8n/nytgames-cli/main/scripts/install.ps1 | powershell -NoProfile -ExecutionPolicy Bypass -Command -`
4844
- Choose install dir: `$env:NYTGAMES_CLI_INSTALL_DIR="C:\\Users\\You\\bin"`
4945

5046
### Linux packages (optional)

scripts/install.ps1

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
param(
22
[string]$Repo = $env:NYTGAMES_CLI_REPO,
3-
[string]$Channel = $env:NYTGAMES_CLI_CHANNEL,
43
[string]$Version = $env:NYTGAMES_CLI_VERSION,
54
[string]$InstallDir = $env:NYTGAMES_CLI_INSTALL_DIR
65
)
@@ -28,13 +27,7 @@ switch ($arch) {
2827
default { throw "unsupported architecture: $arch" }
2928
}
3029

31-
if (-not [string]::IsNullOrWhiteSpace($Channel)) {
32-
switch ($Channel) {
33-
"main" { $Version = "main" }
34-
"nightly" { $Version = "main" }
35-
default { throw "unsupported channel: $Channel" }
36-
}
37-
} elseif ([string]::IsNullOrWhiteSpace($Version)) {
30+
if ([string]::IsNullOrWhiteSpace($Version)) {
3831
$release = Invoke-RestMethod -Headers $headers "https://api.github.com/repos/$Repo/releases/latest"
3932
$tag = $release.tag_name
4033
if (-not $tag) {
@@ -46,11 +39,7 @@ if (-not [string]::IsNullOrWhiteSpace($Channel)) {
4639
}
4740

4841
$asset = "nytgames-cli_${Version}_windows_${arch}.zip"
49-
if ($Version -eq "main") {
50-
$baseUrl = "https://github.com/$Repo/releases/download/main"
51-
} else {
52-
$baseUrl = "https://github.com/$Repo/releases/download/v$Version"
53-
}
42+
$baseUrl = "https://github.com/$Repo/releases/download/v$Version"
5443
$url = "$baseUrl/$asset"
5544
$checksumsUrl = "$baseUrl/checksums.txt"
5645

scripts/install.sh

Lines changed: 13 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ set -euo pipefail
33

44
REPO_DEFAULT="ph8n/nytgames-cli"
55
REPO="${NYTGAMES_CLI_REPO:-$REPO_DEFAULT}"
6-
CHANNEL="${NYTGAMES_CLI_CHANNEL:-}"
76
VERSION="${NYTGAMES_CLI_VERSION:-}"
87
INSTALL_DIR="${NYTGAMES_CLI_INSTALL_DIR:-}"
98

@@ -18,7 +17,6 @@ Usage:
1817
1918
Env:
2019
NYTGAMES_CLI_REPO (default: ${REPO_DEFAULT})
21-
NYTGAMES_CLI_CHANNEL (default: latest; set to "main" for CI builds)
2220
NYTGAMES_CLI_VERSION (default: latest)
2321
NYTGAMES_CLI_INSTALL_DIR (default: ~/.local/bin)
2422
EOF
@@ -38,10 +36,6 @@ while [[ $# -gt 0 ]]; do
3836
VERSION="$2"
3937
shift 2
4038
;;
41-
--channel)
42-
CHANNEL="$2"
43-
shift 2
44-
;;
4539
--dir|--install-dir)
4640
INSTALL_DIR="$2"
4741
shift 2
@@ -79,33 +73,20 @@ if [[ -z "$INSTALL_DIR" ]]; then
7973
INSTALL_DIR="${HOME}/.local/bin"
8074
fi
8175

82-
if [[ -n "$CHANNEL" ]]; then
83-
case "$CHANNEL" in
84-
main|nightly)
85-
tag="main"
86-
VERSION="main"
87-
;;
88-
*)
89-
echo "unsupported channel: ${CHANNEL}" >&2
90-
exit 1
91-
;;
92-
esac
93-
else
94-
VERSION="${VERSION#v}"
95-
if [[ -z "$VERSION" ]]; then
96-
tag="$(
97-
curl -fsSL "https://api.github.com/repos/${REPO}/releases/latest" \
98-
| sed -nE 's/^[[:space:]]*"tag_name":[[:space:]]*"([^"]+)".*$/\1/p' \
99-
| head -n 1
100-
)"
101-
if [[ -z "$tag" ]]; then
102-
echo "failed to resolve latest version from GitHub for ${REPO}" >&2
103-
exit 1
104-
fi
105-
VERSION="${tag#v}"
106-
else
107-
tag="v${VERSION}"
76+
VERSION="${VERSION#v}"
77+
if [[ -z "$VERSION" ]]; then
78+
tag="$(
79+
curl -fsSL "https://api.github.com/repos/${REPO}/releases/latest" \
80+
| sed -nE 's/^[[:space:]]*"tag_name":[[:space:]]*"([^"]+)".*$/\1/p' \
81+
| head -n 1
82+
)"
83+
if [[ -z "$tag" ]]; then
84+
echo "failed to resolve latest version from GitHub for ${REPO}" >&2
85+
exit 1
10886
fi
87+
VERSION="${tag#v}"
88+
else
89+
tag="v${VERSION}"
10990
fi
11091

11192
asset="nytgames-cli_${VERSION}_${os}_${arch}.tar.gz"

0 commit comments

Comments
 (0)