summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <lars.wirzenius@codethink.co.uk>2014-03-06 16:43:41 +0000
committerLars Wirzenius <lars.wirzenius@codethink.co.uk>2014-03-06 19:34:57 +0000
commitf42549fdefb05243cb6e9a46e88aa6185291efde (patch)
tree6b710e4e2a75d8ec0332bde994efe4bc0aa2d2d5
parent9b443cd9b4819647dbf4b65e96099fae0b3d05cc (diff)
downloadmorph-f42549fdefb05243cb6e9a46e88aa6185291efde.tar.gz
Convert colons to slashes for chunk name
-rw-r--r--yarns/implementations.yarn8
-rw-r--r--yarns/morph.shell-lib9
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
+}