From e9cc0b4d9d096bda4fb71077396e3bba0984ec99 Mon Sep 17 00:00:00 2001 From: Pierre Neidhardt Date: Tue, 4 Nov 2014 17:29:52 +0100 Subject: [PATCH] Textadept: Package manager reads from a list of URI and updates/clones --- .textadept/modules/mgr.sh | 22 +++++++++++++++++++++- .textadept/modules/repos | 1 + 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 .textadept/modules/repos diff --git a/.textadept/modules/mgr.sh b/.textadept/modules/mgr.sh index 3b0d2f22..b361eaea 100755 --- a/.textadept/modules/mgr.sh +++ b/.textadept/modules/mgr.sh @@ -1,2 +1,22 @@ #!/bin/sh -git clone https://github.com/rgieseke/textredux.git +source="$HOME/.textadept/modules/repos" +root="$HOME/.textadept/modules/" + +cd "$root" +while IFS= read -r i; do + basename=${i##*/} + vcs=${basename##*.} + basename=${basename%.*} + if [ -n "$vcs" ]; then + if [ -d "$basename/.$vcs" ]; then + cd "$basename" + "$vcs" pull + elif [ ! -d "$basename" ]; then + "$vcs" clone "$i" + else + echo "Warning: Module $basename is present and not under version control" >&2 + fi + else + echo "Error: URI $i lacks VCS extension" >&2 + fi +done <"$source" diff --git a/.textadept/modules/repos b/.textadept/modules/repos new file mode 100644 index 00000000..fee0b89f --- /dev/null +++ b/.textadept/modules/repos @@ -0,0 +1 @@ +https://github.com/rgieseke/textredux.git