Skip to content

Commit 7c2a682

Browse files
vidonnuspraging
andauthored
Bugfix: Jellyseerr pnpm Version (#2033)
* fix jellyseerr-install.sh pnpm version * fix jellyseerr.sh pnpm version * remove version from non-verbose output --------- Co-authored-by: praging <[email protected]>
1 parent 3a33e00 commit 7c2a682

File tree

2 files changed

+21
-13
lines changed

2 files changed

+21
-13
lines changed

ct/jellyseerr.sh

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,17 +50,23 @@ function update_script() {
5050
msg_ok "Cleaning up"
5151
fi
5252

53-
if ! command -v pnpm &> /dev/null; then
54-
msg_error "pnpm not found. Installing..."
55-
npm install -g pnpm &>/dev/null
53+
cd /opt/jellyseerr
54+
output=$(git pull --no-rebase)
55+
56+
pnpm_current=$(pnpm --version 2>/dev/null)
57+
pnpm_desired=$(grep -Po '"pnpm":\s*"\K[^"]+' /opt/jellyseerr/package.json)
58+
59+
if [ -z "$pnpm_current" ]; then
60+
msg_error "pnpm not found. Installing version $pnpm_desired..."
61+
npm install -g pnpm@"$pnpm_desired" &>/dev/null
62+
elif ! node -e "const semver = require('semver'); process.exit(semver.satisfies('$pnpm_current', '$pnpm_desired') ? 0 : 1)" ; then
63+
msg_error "Updating pnpm from version $pnpm_current to $pnpm_desired..."
64+
npm install -g pnpm@"$pnpm_desired" &>/dev/null
5665
else
57-
msg_ok "pnpm is already installed."
66+
msg_ok "pnpm is already installed and satisfies version $pnpm_desired."
5867
fi
5968

6069
msg_info "Updating $APP"
61-
cd /opt/jellyseerr
62-
output=$(git pull --no-rebase)
63-
6470
if echo "$output" | grep -q "Already up to date."; then
6571
msg_ok "$APP is already up to date."
6672
exit
@@ -102,4 +108,4 @@ description
102108
msg_ok "Completed Successfully!\n"
103109
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
104110
echo -e "${INFO}${YW} Access it using the following URL:${CL}"
105-
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:5055${CL}"
111+
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:5055${CL}"

install/jellyseerr-install.sh

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,16 @@ $STD apt-get update
3232
$STD apt-get install -y nodejs
3333
msg_ok "Installed Node.js"
3434

35-
msg_info "Installing pnpm"
36-
$STD npm install -g pnpm
37-
msg_ok "Installed pnpm"
38-
39-
msg_info "Installing Jellyseerr (Patience)"
4035
git clone -q https://github.com/Fallenbagel/jellyseerr.git /opt/jellyseerr
4136
cd /opt/jellyseerr
4237
$STD git checkout main
38+
39+
pnpm_desired=$(grep -Po '"pnpm":\s*"\K[^"]+' /opt/jellyseerr/package.json)
40+
msg_info "Installing pnpm version $pnpm_desired..."
41+
$STD npm install -g pnpm@$pnpm_desired
42+
msg_ok "Installed pnpm"
43+
44+
msg_info "Installing Jellyseerr (Patience)"
4345
export CYPRESS_INSTALL_BINARY=0
4446
$STD pnpm install --frozen-lockfile
4547
export NODE_OPTIONS="--max-old-space-size=3072"

0 commit comments

Comments
 (0)