Skip to content
install.sh 676 B
Newer Older
Pierre Ozoux's avatar
Pierre Ozoux committed
#!/bin/bash -eux

Pierre Ozoux's avatar
Pierre Ozoux committed
curl -Ls https://apps.nextcloud.com/api/v1/platform/${MINOR_VERSION}/apps.json > /tmp/apps.json
Pierre Ozoux's avatar
Pierre Ozoux committed

function download_link() {
  cat /tmp/apps.json | jq '.[] | select(.id == "'$1'") | .releases | map(select(.version|test("alpha|beta|rc|RC|build")|not)) | sort_by(.version | split(".") | map(tonumber))[-1] | .download'
Pierre Ozoux's avatar
Pierre Ozoux committed
}

links=`cat ./install-list | xargs -I@ bash -c "$(declare -f download_link) ; download_link @ ; " | tr -d '"'`

mkdir -p apps
cd apps

for link in $links; do
  echo "downloading $link..."
  curl -Ls $link | tar xz
done
Pierre Ozoux's avatar
Pierre Ozoux committed

# Temp fix for https://github.com/owncloud/music/issues/818
Pierre Ozoux's avatar
Pierre Ozoux committed
cd music && chmod -R 755 dist/ && cd ..
chmod -R 755 ownpad