#!/bin/sh

export XSHAR_REPO=oilshell/oil
export XSHAR_GIT_COMMIT=d2ca09c9ee606365c7b85162947b710d933a5348

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
H4sIAMC/22cAA+07a3PbRpL5zF8xK8UF0CGhhyXLxQ3tU+RHtGvLKkvZXEqnoCBgKMICARwGlMTd
Sn77dffMABgAJKVL7LuqxVTZIoGenn5Pd89w4d2ILdcN4zB3XSddfPMFxjaM53t7+HfnYH+Hvu9u
b9NfNb7Z2Tt4/vzg2cH+M3i/s7O9v/8N2/4SxNTHXORextjXWOr/41ig/q957Ppp+oXUv07/e8/3
Dmr63z7Yf97p/2uMjY2NXql+NmT5PIsZWoXjiSBiGU8zLnice3mYxCyM84QdffddD+dNsmTGXHcy
hzncdVk4S5MsZ2kGUPA09nFKT4EF/PZqHkaBA6s5iN8l/GqOfZol15k3G7BZEgDspPjg8gG7yRcp
H/TYQwbBFpPcfMBOvBk/RwRM5LNc/u8+FB0Bw6TjGP674fdpRrjpQ96XvM0WID3NyWwRhVeV5w49
0G9z71rchbk/HbAouVayAULD+FqD+J7Iez2XjSVED2TA3vEYObABcsAm/RHRvokT+YjZBae0lPNz
FuY867PhS3aSxLxHwD+dugAFSOF/egBUTEtyEHOfeQJX56NCNOGEHqgVuANS6I8MwU2cO1zOtkDn
Vr9XvONRfe5Zni2b+0N4DW+frp7/PhT1xSVHKDAJRTADxWu/fS0E+d4yX1bE65yjgNunvqxRWJUU
jswLBWeHQvAMLf9NliUZCbbU4qkHRm63KbG00hVa1ISmjrKEnkEgeyLgH0udGJBVVn0D1mqjybYZ
jzTldcaDUCBr/NNmPvh8lf1Ix2mxH4WXd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