Fixed design link command to use first match, if project is symlinked into multiple directories

This commit is contained in:
Nathan Broadbent
2012-05-30 11:35:33 +12:00
parent a87d8f3edf
commit 67286496bd

View File

@@ -72,7 +72,7 @@ design() {
echo "== Linking existing Design directories into existing repos..." echo "== Linking existing Design directories into existing repos..."
for design_project in $root_design_dir/projects/*; do for design_project in $root_design_dir/projects/*; do
proj=$(basename $design_project) proj=$(basename $design_project)
repo_path=$(grep "/$proj$" $GIT_REPO_DIR/.git_index) repo_path=$(grep -m1 "/$proj$" $GIT_REPO_DIR/.git_index)
if [ -n "$repo_path" ]; then if [ -n "$repo_path" ]; then
if ! [ -e "$repo_path/$project_design_dir" ]; then if ! [ -e "$repo_path/$project_design_dir" ]; then
ln -fs "$design_project" "$repo_path/$project_design_dir" ln -fs "$design_project" "$repo_path/$project_design_dir"