Last active
August 29, 2015 14:23
-
-
Save kstep/9051def83211d0a386c0 to your computer and use it in GitHub Desktop.
run rust as script
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/sh | |
SELF="$1" | |
MD5=$(md5sum "${SELF}" | cut -f1 -d" ") | |
OUT="${SELF}.${MD5}.out" | |
if [ ! -f "${OUT}" ]; then | |
rustc -C debuginfo=0 -C prefer-dynamic "${SELF}" -o "${OUT}" || exit 1 | |
fi | |
shift | |
exec "${OUT}" "$@" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
E.g.:
Then
chmod a+x hello.rs
and run./hello.rs
.