diff options
| author | Christian Hesse <mail@eworm.de> | 2017-01-11 10:50:02 +0100 |
|---|---|---|
| committer | Christian Hesse <mail@eworm.de> | 2017-01-11 22:40:38 +0100 |
| commit | 3a6788c0d0b50e0cae902cfdc737d1b2624202ba (patch) | |
| tree | d59d106c171a7b9746906283b007844313b7a52e /vis-single.sh | |
| parent | 0a1b23e2a2467eb11673f507c044088f66386a55 (diff) | |
| download | vis-3a6788c0d0b50e0cae902cfdc737d1b2624202ba.tar.gz vis-3a6788c0d0b50e0cae902cfdc737d1b2624202ba.tar.xz | |
single: allow to build self-extracting executable
This allows to create a self extracting executable. The standalone
binary and lua files are extracted to /tmp/.vis-XXXXXX, vis is started
with the given command line arguments, finally temporary files are
removed.
Signed-off-by: Christian Hesse <mail@eworm.de>
Diffstat (limited to 'vis-single.sh')
| -rwxr-xr-x | vis-single.sh | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/vis-single.sh b/vis-single.sh new file mode 100755 index 0000000..b6ff69e --- /dev/null +++ b/vis-single.sh @@ -0,0 +1,14 @@ +#!/bin/sh + +set -e + +VISTMP="$(mktemp -d -p "${TMPDIR:-/tmp}" .vis-XXXXXX)" +trap 'rm -rf "$VISTMP"' EXIT INT QUIT TERM HUP + +sed '1,/^__TAR_GZ_ARCHIVE_BELOW__$/d' "$0" | gzip -d | tar xC "$VISTMP" + +"$VISTMP/vis" "$@" + +exit $? + +__TAR_GZ_ARCHIVE_BELOW__ |
