#!/bin/sh

export XSHAR_REPO=oilshell/oil
export XSHAR_GIT_COMMIT=c3f5ae50b6b51ed10d0995ff56d98925876744fd

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
H4sIAJScw2cAA+08a3PbOJL5rF+BtSdFKiNR8iNxSjtKzuM8xneJ44o9Ozfl9bBoErIYUySPoGxr
t2Z++3U3AJKgKMm5SbJXd0RVLIlsNPqNBtDIwrsRgzzzYjFJspmTLh59+TaE9mx/Hz93Dp7u0O/d
4ZA+4dH+7tO9Rzv7B8+GBzvPhs/2Hg13dvb2Dh6x4VegZanNRe5ljH2Lof43tq2trU5V/azP8nkW
s2kyS655zJO5YHEYPXc8EUQs42nGBY/zMIlZGOcJm/KcZxqyswBrqkF6CNvBYSZZMmOuO5nDANx1
WThLkyxnaQaI4GnsE6QCC/jt1TyMAgdQO0iAS2hVn/jWi+a8pz7d8lve1B2pMrrb75NgHkGvUyA9
82Y9NksC6DMpvrh5r8Me0m7yRQqI6AM6MZHP1F/8dcPv0+zBuI5j6HKe3PC4x87C69hDQfXYiTfj
54C+q2QzW/hp6swWUXilGYqS6x7LvWtxF+b+VMEBSWF8rUF8TwD2d6HIOx2XjbFLp9MBVtl7cIEf
+dlidpVENsqxOyJ6txEDHzFby7bL+i+AtYzehhOSuQOj2l32l3GhC0diGhU8Z14oODsUgmeo4ddZ
lmS29fo+5X7OAybBe+w6ydljYbHHhKlL3TNOxoi0KyocDU5AjjB4QO42c4BQF/rJ5QZmEPjBrCDw
gxmRwJKNMOczzcq59kZAm23mRplYh0B+PnXxJZMM0COwiGlpGhIf8wSSwkvGQAD4wC74Blvsjgyz
VYirLJDBqjG7BnCU+AB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