summaryrefslogtreecommitdiff
path: root/tar-clone
blob: 6fc331554504145bf341e4cb1d60f3f5682730dc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/bash
# 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

set -o pipefail
set -e

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