#!/bin/sh set -e apt-get update apt-get -q -y -o Dpkg::Use-Pty=0 install curl jq REPO_NAME=deltachat/deltachat-desktop TAG_NAME=$(curl --silent --fail --show-error "https://api.github.com/repos/$REPO_NAME/releases/latest" | jq -r .tag_name) GET_SRC_MODE="tar" SRC_DIR_PATH="./" if [ $GET_SRC_MODE = "github-tar" ]; then mkdir tmp_extract curl --silent --fail -L "https://api.github.com/repos/${REPO_NAME}/tarball/${TAG_NAME}" -o - | tar xvz -f - -C "$SRC_DIR_PATH" || rm -rf tmp_extract && exit 1 mv tmp_extract/* ../src else if [ $GET_SRC_MODE = "github" ] git clone "https://github.com/${REPO_NAME}.git" src cd src git checkout "${TAG_NAME}" cd .. else echo "Not valid mode" exit 1 fi fi apt-get -q -y -o Dpkg::Use-Pty=0 --no-install-recommends install npm cargo npm install --no-audit NODE_ENV=production npm run build NO_ASAR=true npm run pack:generate_config npm run pack:linux