Last active
December 18, 2015 07:08
-
-
Save armadillu/5743964 to your computer and use it in GitHub Desktop.
Make Symlinks from a random ofAddons directory into another directory. This script was done to solve this: http://forum.openframeworks.cc/index.php/topic,10966.msg49009.html#msg49009
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 | |
#this is used to make symlinks of the content of one dir to another. | |
#whole point is to allow project generator to use external addons | |
echo "" | |
echo "Use this script to make symlinks of all folders in arg1 into arg2 (arg 1 and arg2 being dirs)" | |
echo "" | |
echo "src dir: $1" | |
echo "destination dir: $2" | |
echo "" | |
if [ $# -lt 2 ]; | |
then | |
echo "Missing Arguments!" | |
echo "usage: makeSymlinksFromTo srcDir destDir" | |
echo "" | |
else | |
externalAddonsPath="$1"; | |
ofAddonsPath="$2"; | |
echo "making symlinks of the addons found in $externalAddonsPath" | |
echo "into $ofAddonsPath" | |
echo "" | |
SAVEIFS=$IFS | |
IFS=$(echo -en "\n\b") | |
for addon in `ls "$externalAddonsPath"` | |
do | |
echo "symlinking $externalAddonsPath/$addon" | |
ln -s "$externalAddonsPath/$addon" "$ofAddonsPath/$addon" | |
done | |
IFS=$SAVEIFS | |
open "$ofAddonsPath" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment