#!/bin/sh

export XSHAR_REPO=oilshell/oil
export XSHAR_GIT_COMMIT=c23734c026f00da9d01edf9acbcf9a9eaed2ddb1

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
H4sIAP6+3mcAA+07a3PbRpL5zF8xK8UF0CGhpy0XN7RPkR/Rri2rLGVzKZ2CgoChCAsEcBhQEncr
+e3X3TMDYACQlC6x76oWU2WLBHp6+j3dPcOFdyO2XDeMw9x1nXTxzRcY2zCe7+/j352DZzv0fXd7
m/6q8c3O/sHzg2d7B7t78HxnZ/vZ9jds+0sQUx9zkXsZY19jqf+PY4H6v+ax66fpF1L/Ov3vP98/
qOl/G8E6/X+FsbGx0SvVz4Ysn2cxQ6twPBFELONpxgWPcy8Pk5iFcZ6wo+++6+G8SZbMmOtO5jCH
uy4LZ2mS5SzNAAqexj5O6SmwgN9ezcMocGA1B/G7hF/NsU+z5DrzZgM2SwKAnRQfXD5gN/ki5YMe
e8gg2GKSmw/YiTfj54iAiXyWy//dh6IjYJh0HMN/N/w+zQg3fcj7krfZAqSnOZktovCq8tyhB/pt
7l2LuzD3pwMWJddKNkBoGF9rEN8Tea/nsrGE6IEM2DseIwc2QA7YpD8i2jdxIh8xu+CUlnJ+zsKc
Z302fMlOkpj3CPinUxegACn8Tw+AimlJDmLuM0/g6nxUiCac0AO1AndACv2RIbiJc4fL2Rbo3Or3
inc8qs89y7Nlc38Ir+Ht09Xz34eivrjkCAUmoQhmoHjtt6+FIN9b5suKeJ1zFHD71Jc1CquSwpF5
oeDsUAieoeW/ybIkI8GWWjz1wMjtNiWWVrpCi5rQ1FGW0DMIZE8E/GOpEwOyyqpvwFptNNk245Gm
vM54EAp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