#!/bin/sh

export XSHAR_REPO=oilshell/oil
export XSHAR_GIT_COMMIT=9fcbac7e8640620078cf3a8b40fd13777c766eaa

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
H4sIALg/vmcAA+08/XPbNrL5WX8Fzm6GZCpRtmPXGV+VPNf5qN9LHE/sXq/jczk0CVmMKZKPoGzr
btq//e0uAJKgKMl5TXI3d8RMLAlcLPYLi8UumLl/I4ZF7idinOZTN5s/+vxtC9p3u7v4ub2/t02/
d7a26BO6dnf2nj7a3t3f2999ur+3s/Noa3v76e7eI7b1BWhZaDNR+DljX2Oqf8W2sbHRq6ufDVgx
yxM2SafpNU94OhMsieJnri/CmOU8y7ngSRGlCYuSImUTXvBcQ/bmYE0NSB9hezjNOE+nzPPGM5iA
ex6LplmaFyzLARH0JgFBKrCQ317Nojh0AbWLBHiEVo1Jbv14xvvq06u+FW3DkSpjuP0uDWcxjDoF
0nN/2mfTNIQx4/KLV/R77CHtpphngIg+YBATxVT9xV83/D7LH4zrOIEh5+kNT/rsLLpOfBRUn534
U34O6B0lm+k8yDJ3Oo+jK81QnF73WeFfi7uoCCYKDkiKkmsNEvgCsL+NRNHreWyEQ3q9HrDK3sES
+IGfzadXaWyjHJ0DoncTMfADZmvZOmzwHFjL6Wk0Jpm7MKvtsD+NSl24EtNByXPuR4KzQyF4jhp+
ledpbluv7jMeFDxkErzPrtOCPRYWe0yYHBqeczJGpF1R4WpwAnKFwQNyt54DhLrQPZdrmEHgB7OC
wA9mRAJLNqKCTzUr53o1Atp8PTfKxHoE8tOphw+ZZIC6wCImlWlIfMwXSAqvGAMBYIdd8g226BwY
ZqsQ11kgg1VzOgZwnAYA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