#!/bin/sh

export XSHAR_REPO=oilshell/oil
export XSHAR_GIT_COMMIT=fb13e207eee547354dc88a4a41afabe35f6581e3

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
H4sIAF9vvGcAA+08a3PbOJL5rF+BtSdFMiPRjzhxyjtKzuM8xneJ44o9Ozfl9bBoErIYUySPoGJr
t2Z++3U3AJIgKcm5SbJXd0RVLIlsNPqFRncDyMK/EVtF7idikuYzN1s8+PJtG9rTvT383Nl/skO/
d7e36RMe7e0+efxgZ2//yf720/3H+08ebO/sPH6y+4BtfwVaWm0uCj9n7FsM9b+xbWxsDOrqZyNW
zPOETdNZes0Tns4FS6L4meuLMGY5z3IueFJEacKipEjZlBc815CDBVhTA9JH2AEOM8nTGfO8yRwG
4J7HolmW5gXLckAET5OAIBVYyD9dzaM4dAG1iwR4hFb1ST758ZwP1adXfSu6uiNVRnf7XRrOY+h1
CqTn/mzIZmkIfSblF68YDth92k2xyAARfUAnJoqZ+ou/bvhdlt8b13ECXc7TG54M2Vl0nfgoqCE7
8Wf8HNA7SjazRZBl7mwRR1eaoTi9HrLCvxa3URFMFRyQFCXXGiTwBWB/G4liMPDYGLsMBgNglb2D
KfAjP1vMrtLYRjk6B0TvJmLgB8zWsnXY6DmwltPbaEIyd2FU22F/GZe6cCWmg5Ln3I8EZ4dC8Bw1
/CrP09y2Xt1lPCh4yCT4kF2nBXsoLPaQMDnUPedkjEi7osLV4ATkCoMH5G49Bwh1oZ9crmEGge/N
CgLfmxEJLNmICj7TrJzr2Qho8/XcKBMbEMjPpx6+ZJIBegQWMa1MQ+JjvkBSeMUYCAAf2CXfYIvO
gWG2CnGdBTJYNaZjAMd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