#!/bin/bash

VERSION=$1

rm -rf nextcloud-client-*.tar.?z

echo "Downloading nextcloud-client-$VERSION..."

wget "https://github.com/nextcloud/desktop/archive/v$VERSION/desktop-$VERSION.tar.gz"

tar xf desktop-$VERSION.tar.gz

mv desktop-$VERSION nextcloud-client-$VERSION

tar cf nextcloud-client-$VERSION.tar nextcloud-client-$VERSION
plzip -9 nextcloud-client-$VERSION.tar

rm -rf nextcloud-client-$VERSION desktop-$VERSION.tar.?z
