change url validation
This commit is contained in:
@ -32,8 +32,8 @@ function update_script() {
|
||||
msg_info "Updating $APP LXC"
|
||||
temp_file="$(mktemp)"
|
||||
rm -rf /opt/huntarr
|
||||
RELEASE=$(curl -fsSL https://api.github.com/repos/huntarr/huntarr/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
|
||||
curl -fsSL "https://github.com/huntarr/huntarr/archive/refs/tags/${RELEASE}.tar.gz" -o "$temp_file"
|
||||
RELEASE=$(curl -fsSL https://api.github.com/repos/plexguide/Huntarr.io/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
|
||||
curl -fsSL "https://github.com/plexguide/Huntarr.io/archive/refs/tags/${RELEASE}.tar.gz" -o "$temp_file"
|
||||
$STD mkdir -p /opt/huntarr
|
||||
$STD tar -xzf "$temp_file" -C /opt/huntarr --strip-components=1
|
||||
|
||||
|
||||
@ -30,7 +30,33 @@ curl -fsSL "https://github.com/plexguide/Huntarr.io/archive/refs/tags/${RELEASE}
|
||||
|
||||
$STD mkdir -p /opt/huntarr
|
||||
$STD tar -xzf "$temp_file" -C /opt/huntarr --strip-components=1
|
||||
cd /opt/huntarr
|
||||
|
||||
# Check if package.json exists
|
||||
if [ ! -f "/opt/huntarr/package.json" ]; then
|
||||
msg_info "Looking for package.json in subdirectories"
|
||||
# Try to find package.json in subdirectories
|
||||
PACKAGE_DIR=$(find /opt/huntarr -name package.json -type f -print -quit | xargs dirname)
|
||||
|
||||
if [ -n "$PACKAGE_DIR" ]; then
|
||||
msg_info "Found package.json in $PACKAGE_DIR"
|
||||
# Create symlinks or copy files to right locations
|
||||
cp -R "$PACKAGE_DIR"/* /opt/huntarr/
|
||||
cd /opt/huntarr
|
||||
else
|
||||
msg_error "Could not find package.json in the extracted files"
|
||||
# Attempt to use a specific version that's known to work
|
||||
msg_info "Trying alternate repository or specific version"
|
||||
rm -rf /opt/huntarr
|
||||
$STD mkdir -p /opt/huntarr
|
||||
$STD curl -fsSL "https://github.com/huntarr/huntarr/archive/refs/heads/master.tar.gz" -o "$temp_file"
|
||||
$STD tar -xzf "$temp_file" -C /opt/huntarr --strip-components=1
|
||||
cd /opt/huntarr
|
||||
fi
|
||||
else
|
||||
cd /opt/huntarr
|
||||
fi
|
||||
|
||||
# Now install after finding the correct directory
|
||||
$STD npm install
|
||||
$STD npm run build
|
||||
chmod 775 /opt/huntarr
|
||||
|
||||
Reference in New Issue
Block a user