#!/bin/bash -eux

for url in $(cat nextcloud.json | jq -r .apps[]); do 
  echo Install $url
  curl -Ls $url | tar xz
done

curl -Ls "https://hot-objects.liiib.re/artifacts/scimserviceprovider.tar.gz" | tar xz

# Temp fix for https://github.com/owncloud/music/issues/818
cd music && chmod -R 755 dist/ && cd ..
chmod -R 755 ownpad
