#!/bin/sh

export XSHAR_REPO=oilshell/oil
export XSHAR_GIT_COMMIT=85250aa18375fbffbce178ed6ddbabec2753d7ba

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
H4sIAKzGvWcAA+08/XPbtpL9WX8Fnt0MyVSi/JU641cl5zof9Z3jeGL39Tp+LocmIYsxRfIIyrbe
m/Zvv90FQBIUJTnXJO/mjpiJJYGLxX5hsdgFM/dvxbDI/USM03zqZvNvPn/bgvb93h5+bu8/26bf
O1tb9AldezvPdr/Z3tt/tr+7t7u9Df3b27u7O9+wrS9Ay0KbicLPGfsaU/1vbBsbG726+tmAFbM8
YZN0mt7whKczwZIofu76IoxZzrOcC54UUZqwKClSNuEFzzVkbw7W1ID0EbaH04zzdMo8bzyDCbjn
sWiapXnBshwQQW8SEKQCC/nd9SyKQxdQu0iAR2jVmOTOj2e8rz696lvRNhypMobb79JwFsOoMyA9
96d9Nk1DGDMuv3hFv8ce026LeQaI6AMGMVFM1V/8dcsfsvzRuI4TGHKR3vKkz86jm8RHQfXZqT/l
F4DeUbKZzoMsc6fzOLrWDMXpTZ8V/o24j4pgouCApCi50SCBLwD7SSSKXs9jIxzS6/WAVfYOlsCP
/Hw+vU5jG+XoHBC9m4iBHzBby9ZhgxfAWk5PozHJ3IVZbYf9ZVTqwpWYDkqecz8SnB0KwXPU8Os8
T3Pbev2Q8aDgIZPgfXaTFuyJsNgTwuTQ8JyTMSLtigpXgxOQKwwekLv1HCDUpe65WsMMAj+aFQR+
NCMSWLIRFXyqWbnQqxHQ5uu5USbWI5Cfzzx8yCQD1AUWMalMQ+JjvkBSeMUYCAA77JJvsEXnwDBb
hbjOAhmsmtMxg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