Created
March 29, 2015 23:48
-
-
Save dilworks/52cf6de4145b771361f4 to your computer and use it in GitHub Desktop.
Worst spaces-in-paths workaround for Steam/primusrun ever
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
#!/bin/bash | |
echo "CMD: $@" | |
echo "ARGS: $#" | |
BASEPATH="" | |
if [ -f "$1" ] | |
then | |
echo "Valid at 1" | |
BASEPATH=$1 | |
shift | |
else | |
if [ -f "$1 $2" ] | |
then | |
echo "Valid at 2" | |
BASEPATH="$1 $2" | |
shift | |
shift | |
else | |
if [ -f "$1 $2 $3" ] | |
then | |
echo "Valid at 3" | |
BASEPATH="$1 $2 $3" | |
shift | |
shift | |
shift | |
else | |
echo "Give up..." | |
exit 1 | |
fi | |
fi | |
fi | |
echo $BASEPATH | |
echo "ARGS now: $@" | |
primusrun "$BASEPATH" "$@" | |
exit $? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment