#!/bin/sh

export XSHAR_REPO=oilshell/oil
export XSHAR_GIT_COMMIT=8ad5708a3d989a48b8fa4336f0e0bfcb0374cc96

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
H4sIAE505WcAA+07a3PbRpL5zF8xK8UF0CFBSZajFDe0T5Ef0a4tqyxlcymdgoKAoQgLBHAYUBJ3
K/nt190zA2AAkJQuse+qFlNliwR6evo93T3DpXcjRq4bxmHuuk66/OozjB0Y3+7v49/dg+e79H1v
Z4f+qvHV7v7Bwe7ewe7B/rdf7ezu7jzf+4rtfA5i6mMhci9j7Ess9f9xLFH/1zx2/TT9TOrfpP/9
b/cPavrfOXj+rNP/lxhbW1u9Uv1syPJFFjO0CscTQcQynmZc8Dj38jCJWRjnCTv65psezptmyZy5
7nQBc7jrsnCeJlnO0gyg4Gns45SeAgv47dUijAIHVnMQv0v41Rz7NEuuM28+YPMkANhp8cHlA3aT
L1M+6LGHDIItJrn5gJ14c36OCJjI57n8330oOgKGSccx/HfD79OMcNOHvC95my9BepqT+TIKryrP
HXqg3+betbgLc382YFFyrWQDhIbxtQbxPZH3ei6bSIgeyIC95TFyYAPkgE37Y6J9GyfyMbMLTmkp
5+cszHnWZ8MX7CSJeY+Afzp1AQqQwv/0AKiYleQg5j7zBK7Ox4Vowik9UCtwB6TQHxuCmzp3uJxt
gc6tfq94x6P63LM8WzX3h/Aa3j5dP/9dKOqLS45QYBKKYAaK1377WgjyvWW+rIjXOUcBt099UaOw
KikcmRcKzg6F4Bla/ussSzISbKnFUw+M3G5TYmmla7SoCU0dZQk9g0D2RMA/ljoxIKus+hqs1UaT
bTMeacqbjAehQNb4p8188Pk6+5GO02I/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