summaryrefslogtreecommitdiff
path: root/tar-clone
diff options
context:
space:
mode:
authorRichard Maw <richard.maw@gmail.com>2013-11-05 20:47:12 +0000
committerRichard Maw <richard.maw@gmail.com>2013-11-05 20:48:00 +0000
commit2c852a412d923cf71b7747e91696f94ca711ae20 (patch)
treee6cdc56dff3d2bef457fe4ec248c394cc4900d0b /tar-clone
parentb249e5de5119f25e872f5af4f93a810271339bbf (diff)
downloadtar-clone-2c852a412d923cf71b7747e91696f94ca711ae20.tar.bz2
Tidy up to be more useful as a stand-alone tool
Diffstat (limited to 'tar-clone')
-rwxr-xr-xtar-clone15
1 files changed, 15 insertions, 0 deletions
diff --git a/tar-clone b/tar-clone
new file mode 100755
index 0000000..7787f96
--- /dev/null
+++ b/tar-clone
@@ -0,0 +1,15 @@
+#!/bin/sh
+# A wrapper to make tar-clone.lua behave like a normal git clone
+# and deal with library paths, so lua-archive does not need to be
+# installed
+
+LUA=lua5.1
+CURDIR=$(readlink -f "$(dirname "$0")")
+LUA_CPATH="$CURDIR/lua-archive/?.so;$($LUA -e'print(package.cpath)')"
+export LUA_CPATH
+
+SOURCE="$1"
+TARGET="$2"
+$LUA "$CURDIR/tar-clone.lua" "$SOURCE" "$TARGET" | tar x
+cd "$TARGET"
+git reset --hard HEAD