-
Notifications
You must be signed in to change notification settings - Fork 653
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Produce a single-file self-extracting script for OSS
Summary: For the benefit of Buck, homebrew, and all the users who have no idea what redex-all is, we'll now build redex as a magic self-extracting script. The script contains a bash extraction preamble followed by a tar file containing redex-all and the python wrapper (and libraries). When `redex` is invoked it untars this payload to a temp location, executes redex with the specified parameters, and then deletes the untarred payload. Differential Revision: D4401602 fbshipit-source-id: 94fa04d7a966be55ab86720c4d426ea566b562bb
- Loading branch information
1 parent
b47750b
commit 6ceb976
Showing
4 changed files
with
32 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/bash | ||
|
||
tar czf redex.tar.gz redex-all redex.py pyredex/*.py | ||
cat selfextract.sh redex.tar.gz > redex | ||
chmod +x redex |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/bin/bash | ||
|
||
export TMPDIR=`mktemp -d /tmp/redex.XXXXXX` | ||
ARCHIVE=`awk '/^__ARCHIVE_BELOW__/ { print NR + 1; exit 0 }' $0` | ||
tail -n+$ARCHIVE $0 | tar xz -C $TMPDIR | ||
|
||
$TMPDIR/redex.py $@ | ||
|
||
rm -rf $TMPDIR | ||
exit 0 | ||
|
||
__ARCHIVE_BELOW__ |