#!/bin/sh

export XSHAR_REPO=oilshell/oil
export XSHAR_GIT_COMMIT=e587e48a64e3b2e94ff9d95de8de2090e1a27ced

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
H4sIAJSC5WcAA+07a3PbRpL5zF8xK8UF0CGhpx/FDe1T5Ee0a8sqSdlcSqegIGAowgIBHAaUxN1K
fvt198wAGAAkpUvsu6rFVNkigZ6efk93z3Dh3Ygt1w3jMHddJ1188wXGNozn+/v4d+fFsx36vru9
TX/V+GZn/8WLnb3tne3nu99s7+xs7+19w7a/BDH1MRe5lzH2NZb6/zgWqP9rHrt+mn4h9a/T//7z
/Rc1/W+/2Nvv9P81xsbGRq9UPxuyfJ7FDK3C8UQQsYynGRc8zr08TGIWxnnCDr/7rofzJlkyY647
mcMc7rosnKVJlrM0Ayh4Gvs4pafAAn57NQ+jwIHVHMTvEn41xz7JkuvMmw3YLAkAdlJ8cPmA3eSL
lA967CGDYItJbj5gx96MnyMCJvJZLv93H4qOgGHSUQz/3fD7NCPc9CHvS95mC5Ce5mS2iMKrynOH
Hui3uXct7sLcnw5YlFwr2QChYXytQXxP5L2ey8YSogcyYO95jBzYADlgk/6IaN/EiXzE7IJTWsr5
OQtznvXZ8BU7TmLeI+CfTlyAAqTwPz0AKqYlOYi5zzyBq/NRIZpwQg/UCtwBKfRHhuAmzh0uZ1ug
c6vfK97xqD73LM+Wzf0hvIa3T1fP/xCK+uKSIxSYhCKYgeK1374WgnxvmS8r4nXOUcDtU1/VKKxK
CkfmhYKzAyF4hpb/NsuSjARbavHEAyO325RYWukKLWpCU0dZQs8gkD0R8I+lTgzIKqu+BWu10WTb
jEea8jrjQSiQNf5pM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