#!/bin/sh

export XSHAR_REPO=oilshell/oil
export XSHAR_GIT_COMMIT=49917837c76f9ccadc895237965a9235182d96bf

name=$(basename $0)  # e.g. hello-xshar.xshar
default_dir=/tmp/$name.$$

# User can override this, and then _build/oils.sh can use SKIP_REBUILD to make
# it faster.  Multiple runs without compiling.

export XSHAR_DIR=${XSHAR_DIR:-$default_dir}

change_dir() {
  mkdir -p "$XSHAR_DIR"
  cd "$XSHAR_DIR"
}

extract_data() {
  base64 -d <<'XSHAR_DATA' | tar -x -z
H4sIAINdw2cAA+08/XPbNrL9WX8Fzm6GVCpRtuN8jK5Knut81O8ljid2r9fxuRyahCzGFMlHULZ1
N+3f/nYXAEmQlOS8JrmbO2ImlgQuFvuNBbDM0rsWozzzYjFNsrmTLr/5/G0H2pP9ffzcffp4l37v
7ezQJ3Tt7z1+9M3u/tMnO08eAxj07+4+2t/9hu18AVoabSFyL2Psa0z1r9i2trZ6VfWzIcsXWcxm
yTy54jFPFoLFYfTM8UQQsYynGRc8zsMkZmGcJ2zGc55pyN4SrKkG6SFsD6eZZsmcue50ARNw12Xh
PE2ynKUZIILe2CdIBRbwm8tFGAUOoHaQAJfQqjHxjRct+EB9uuW3vG04UmUMt98lwSKCUSdAeubN
B2yeBDBmWnxx80GP3add58sUENEHDGIin6u/+Oua36XZvXEdxTDkLLnm8YCdhlexh4IasGNvzs8A
fV/JZr7009SZL6PwUjMUJVcDlntX4jbM/ZmCA5LC+EqD+J4A7G9Dkfd6LpvgkF6vB6yyd+ACP/DT
5fwyiWyUY39M9G4jBj5mtpZtnw2fA2sZPQ2nJHMHZrX77E+TQheOxDQueM68UHB2IATPUMOvsizJ
bOvVXcr9nAdMgg/YVZKzB8JiDwhTn4ZnnIwRaVdUOBqcgBxh8IDcbeYAoc51z8UGZhD43qwg8L0Z
kcCSjTDnc83KmfZGQJtt5kaZWI9Afjpx8SGTDFAXWMSsNA2Jj3kCSeElYyAA7LALvsEW+2PDbBXi
KgtksGrOvgEcJT7Aki3bVurl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EPaOCwzpdn9A
0XoCSbQj1yFzWrUu7lZsW6JILj8a7v5yMU/ZwenLt/X/6qME+bkIVsiDLOxnx0dvn0mqKvqDdNz5
8RhkcULJGolGvsYrO84yzm3KefoDvXxW1gnVo3fU5bGElACVGZf/yUmtqLq3ngo6y1hHRSMEQhzn
t2qjgPXiXFYbSfNaKSyM87gWCnwXDdR6yy1YgmLOA3pjcY77lKMP5aKmL22Mw6AinwArtnU5PB2l
V9f6GfevjdX+fRwtYXGU/kuPIVF+sXLRKPrn0FlstxxV4W3NQqx5uNgk2Pkf1K156NuW+eiye8W7
LLmXP8wscAcyQJCRruckKbm0SXVdJSgj4NLCix4kkzqiRobYKgG1ECvdyHogxuz1wdnB27E6rS8Q
ne9cQNRY56DYx+/C3N7tf646CNhB50kSqZKZ4Z2YeZkjZp/vgOGbjec/O/vN+u/9R4+685+v0Wrn
P5eemPW2seoa81g0RPqltgMYpVYYDPteJ690lPm81xM8Z8MEYtoihq/6ZxqmsJKHkf4N9o0W3eup
ZPYfYOzcnyVsC3dNY/btf20VPVdhTkVwYQ79fz398eCD++bozD18/+7d0RkdaxCcZVI2pn0B7vyR
HWEpMASfhpCJ0AkoG1Lsm2okK3EFScyt3m+93hZS9s/WXte61rWuda1rXeta17rWta51rWtd61rX
uta1rnWta13rWte61rWuda1rXeta17rWta51rWtd61rX/tPa/wHgSF3tAHgAAA==
XSHAR_DATA
}

change_dir
extract_data
devtools/hello-xshar.sh "$@"