#!/bin/sh

export XSHAR_REPO=oilshell/oil
export XSHAR_GIT_COMMIT=22faf632a58ffd07348e0376d83328498cf38bf3

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
H4sIAA/ZyWcAA+07a3PbRpL5zF8xK8UF0CGhpx/FDe1T5Ee0a8sqSdlcSqegIGAowgIBHAaUxN1K
fvt198wAGAAkpUvsu6rFVNkigZ6efk93z3Dh3Ygt1w3jMHddJ1188wXGNozn+/v4d+fFsx36vru9
TX/V+GZn/8Xz3b1n+7vP4fnOzvb+3jds+0sQUx9zkXsZY19jqf+PY4H6v+ax66fpF1L/Ov3vP99/
UdP/9gsA7/T/FcbGxkavVD8bsnyexQytwvFEELGMpxkXPM69PExiFsZ5wg6/+66H8yZZMmOuO5nD
HO66LJylSZazNAMoeBr7OKWnwAJ+ezUPo8CB1RzE7xJ+Ncc+yZLrzJsN2CwJAHZSfHD5gN3ki5QP
euwhg2CLSW4+YMfejJ8jAibyWS7/dx+KjoBh0lEM/93w+zQj3PQh70veZguQnuZktojCq8pzhx7o
t7l3Le7C3J8OWJRcK9kAoWF8rUF8T+S9nsvGEqIHMmDveYwc2AA5YJP+iGjfxIl8xOyCU1rK+TkL
c5712fAVO05i3iPgn05cgAKk8D89ACqmJTmIuc88gavzUSGacEIP1ArcASn0R4bgJs4dLmdboHOr
3yve8ag+9yzPls39IbyGt09Xz/8QivrikiMUmIQimIHitd++FoJ8b5kvK+J1zlHA7VNf1SisSgpH
5oWCswMheIaW/zbLkowEW2rxxAMjt9uUWFrpCi1qQlNHWULPIJA9EfCPpU4MyCqrvgVrtdFk24xH
mvI640EokDX+aTMffL7KfqTjtNiPwks6JB9T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