mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-12-28 00:52:29 +03:00
47d374a09a
This archive in tar.gz format contains the whole Atom binary and resources to enable multiple channels and versions to be installed on the same distribution.
40 lines
767 B
Bash
Executable File
40 lines
767 B
Bash
Executable File
#!/bin/bash
|
|
# mktar name version arch icon-path build-root-path
|
|
|
|
set -e
|
|
|
|
SCRIPT=`readlink -f "$0"`
|
|
ROOT=`readlink -f $(dirname $SCRIPT)/..`
|
|
cd $ROOT
|
|
|
|
NAME="$1"
|
|
VERSION="$2"
|
|
ARCH="$3"
|
|
ICON_FILE="$4"
|
|
BUILD_ROOT_PATH="$5"
|
|
FILE_MODE=755
|
|
|
|
TAR_PATH=$BUILD_ROOT_PATH
|
|
ATOM_PATH="$BUILD_ROOT_PATH/Atom"
|
|
|
|
TARGET_ROOT="`mktemp -d`"
|
|
chmod $FILE_MODE "$TARGET_ROOT"
|
|
NAME_IN_TAR="$NAME-$VERSION-$ARCH"
|
|
TARGET="$TARGET_ROOT/$NAME_IN_TAR"
|
|
|
|
# Copy executable and resources
|
|
cp -a "$ATOM_PATH" "$TARGET"
|
|
|
|
# Copy icon file
|
|
cp "$ICON_FILE" "$TARGET/$NAME.png"
|
|
|
|
# Remove executable bit from .node files
|
|
find "$TARGET" -type f -name "*.node" -exec chmod a-x {} \;
|
|
|
|
# Create the archive
|
|
pushd "$TARGET_ROOT"
|
|
tar caf "$TAR_PATH/$NAME_IN_TAR.tar.gz" "$NAME_IN_TAR"
|
|
popd
|
|
|
|
rm -rf "$TARGET_ROOT"
|