#!/bin/sh

export XSHAR_REPO=oilshell/oil
export XSHAR_GIT_COMMIT=b56f50ef1b861495de91674c1cb6143d8fe8a8c6

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
H4sIAFQ/y2cAA+07/XPbtpLvZ/0VeHYzpFKJsh0n7uhVybnOR32XOJ7Yfb2Oz+XQJGQxpkgeQdnW
e9P+7be7AEiCpCT72uRu5hEziSVysdhv7C6gpXcjRq4bxmHuuk66/MsXGDswXuzv49/dg+e79H1v
Z4f+qvGX3f2DF3svnh08ewHvd3d3AIztfAli6mMhci9j7Gss9f9xLFH/1zx2/TT9QurfpP/9F/sH
Nf3vHDzf6/T/NcbW1lavVD8bsnyRxQytwvFEELGMpxkXPM69PExiFsZ5wo6+/baH86ZZMmeuO13A
HO66LJynSZazNAMoeBr7OKWnwAJ+e7UIo8CB1RzE7xJ+Ncc+zZLrzJsP2DwJAHZafHD5gN3ky5QP
euwhg2CLSW4+YCfenJ8jAibyeS7/dx+KjoBh0nEM/93w+zQj3PQh70ve5kuQnuZkvozCq8pzhx7o
t7l3Le7C3J8NWJRcK9kAoWF8rUF8T+S9nssmEqIHMmDveIwc2AA5YNP+mGjfxol8zOyCU1rK+TkL
c5712fAlO0li3iPgn05dgAKk8D89ACpmJTmIuc88gavzcSGacEoP1ArcASn0x4bgps4dLmdboHOr
3yve8ag+9yzPVs39IbyGt0/Xz38fivrikiMUmIQimIHitd++FoJ8b5kvK+J1zlHA7VNf1iisSgpH
5oWCs0MheIaW/ybLkowEW2rx1AMjt9uUWFrpGi1qQlNHWULPIJA9EfCPpU4MyCqrvgFrtdFk24xH
mvIm40EokDX+aTMffL7OfqTjtNiPwks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