Last active
May 7, 2019 14:13
-
-
Save jjacobson93/b274bd52bee0c41f61865e8e1b261f8f to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#!/bin/bash | |
BIN="$1" | |
OUTPUT_TAR="${2:-swift_libs.tar.gz}" | |
TAR_FLAGS="hczvf" | |
DEPS=$(ldd $BIN | awk 'BEGIN{ORS=" "}$1\ | |
~/^\//{print $1}$3~/^\//{print $3}'\ | |
| sed 's/,$/\n/') | |
tar $TAR_FLAGS $OUTPUT_TAR $DEPS |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment