#!/usr/bin/env bash set -e DIR="$(dirname "$(realpath "$BASH_SOURCE")")" source app source archiveFile="$de_distro.tar.gz" cd "$DIR" if [ -f "$archiveFile" ]; then rm "$archiveFile"; fi cd ".." if [ -f "$archiveFile" ]; then rm "$archiveFile"; fi tar -czf "$archiveFile" -C "$DIR" . mv "$archiveFile" "$DIR"