Update homepage.sh

update to /releases/latest
This commit is contained in:
tteckster 2023-12-17 20:23:32 -05:00 committed by GitHub
parent 144c067c6f
commit 0909ad493b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 9 deletions

View File

@ -53,17 +53,19 @@ function default_settings() {
function update_script() { function update_script() {
header_info header_info
if [[ ! -d /opt/homepage ]]; then msg_error "No ${APP} Installation Found!"; exit; fi if [[ ! -d /opt/homepage ]]; then msg_error "No ${APP} Installation Found!"; exit; fi
msg_info "Updating ${APP}" RELEASE=$(curl -s https://api.github.com/repos/gethomepage/homepage/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
if ! command -v pnpm >/dev/null 2>&1; then msg_info "Updating Homepage to v${RELEASE} (Patience)"
npm install -g pnpm &>/dev/null
fi
cd /opt/homepage
systemctl stop homepage systemctl stop homepage
git pull --force &>/dev/null wget -q https://github.com/gethomepage/homepage/archive/refs/tags/v${RELEASE}.tar.gz
pnpm install &>/dev/null tar -xzf v${RELEASE}.tar.gz
pnpm build &>/dev/null cp -r homepage-${RELEASE}/* /opt/homepage/
rm -rf mv homepage-${RELEASE}
cd /opt/homepage
npx update-browserslist-db@latest
pnpm install
pnpm build
systemctl start homepage systemctl start homepage
msg_ok "Updated Successfully" msg_ok "Updated Homepage to v${RELEASE}"
exit exit
} }