#!/usr/bin/env bash set -euxo pipefail # Function for displaying help info help_info() { echo " Usage: ${0##*/} [options] Build a release .tar.gz for Linux. Options: -h Display this help and exit. " } while getopts 'h' flag do case "${flag}" in h) help_info exit 0 ;; esac done export ZED_BUNDLE=true channel=$( "${zed_dir}/share/applications/zed$suffix.desktop" # Copy generated licenses so they'll end up in archive too cp "assets/licenses.md" "${zed_dir}/licenses.md" # Create archive out of everything that's in the temp directory arch=$(uname -m) target="linux-${arch}" if [[ "$channel" == "dev" ]]; then archive="zed-${commit}-${target}.tar.gz" else archive="zed-${target}.tar.gz" fi rm -rf "${archive}" remove_match="zed(-[a-zA-Z0-9]+)?-linux-$(uname -m)\.tar\.gz" ls "${target_dir}/release" | grep -E ${remove_match} | xargs -d "\n" -I {} rm -f "${target_dir}/release/{}" || true tar -czvf "${target_dir}/release/$archive" -C ${temp_dir} "zed$suffix.app" gzip --stdout --best "${target_dir}/${target_triple}/release/remote_server" > "${target_dir}/zed-remote-server-linux-${arch}.gz"