From f42549fdefb05243cb6e9a46e88aa6185291efde Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Thu, 6 Mar 2014 16:43:41 +0000 Subject: Convert colons to slashes for chunk name --- yarns/implementations.yarn | 8 +++++--- yarns/morph.shell-lib | 9 +++++++++ 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/yarns/implementations.yarn b/yarns/implementations.yarn index 276ed2f3..3e5b3ab5 100644 --- a/yarns/implementations.yarn +++ b/yarns/implementations.yarn @@ -433,7 +433,8 @@ Editing morphologies with `morph edit`. IMPLEMENTS THEN the edited chunk (\S+) has git branch (\S+) ls -l "$DATADIR/workspace/$MATCH_2" - cd "$DATADIR/workspace/$MATCH_2/$MATCH_1" + chunkdir="$(slashify_colons "$MATCH_1")" + cd "$DATADIR/workspace/$MATCH_2/$chunkdir" git branch | awk '$1 == "*" { print $2 }' > "$DATADIR/git-branch.actual" echo "$MATCH_2" > "$DATADIR/git-branch.wanted" diff -u "$DATADIR/git-branch.wanted" "$DATADIR/git-branch.actual" @@ -494,11 +495,12 @@ Reporting status of checked out repositories: touch "$DATADIR/workspace/$MATCH_3/$MATCH_2/$MATCH_1" IMPLEMENTS WHEN adding file (\S+) in (\S+) in branch (\S+) to git - cd "$DATADIR/workspace/$MATCH_3/$MATCH_2" + chunkdir="$(slashify_colons "$MATCH_2")" + cd "$DATADIR/workspace/$MATCH_3/$chunkdir" git add "$MATCH_1" IMPLEMENTS WHEN committing changes in (\S+) in branch (\S+) - cd "$DATADIR/workspace/$MATCH_2/$MATCH_1" + cd "$DATADIR/workspace/$MATCH_2/$(slashify_colons "$MATCH_1")" git commit -a -m test-commit Running shell command in each checked out repository: diff --git a/yarns/morph.shell-lib b/yarns/morph.shell-lib index 4ce8c2f8..05c11bcc 100644 --- a/yarns/morph.shell-lib +++ b/yarns/morph.shell-lib @@ -174,3 +174,12 @@ then email = tomjon@codethink.co.uk EOF fi + + +# Change colons to slashes. This is used when converting an aliases +# repository URL (e.g., test:morphs) into a directory path. + +slashify_colons() +{ + echo "$1" | sed s,:,/,g +} -- cgit v1.2.1