#!/bin/sh

export XSHAR_REPO=oilshell/oil
export XSHAR_GIT_COMMIT=c49c659ff2709060c2d05e858178519b5b4720b3

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
H4sIALcA3mcAA+07a3PbRpL5zF8xK8UF0CFBSZajFDe0T5Ef0a4tqyxlcymdgoKAoQgLBHAYUBJ3
K/nt190zA2AAkJQuse+qFlNliwR6evo93T3DpXcjRq4bxmHuuk66/OozjB0Y3+7v49/dg+e79H1v
Z4f+qvHV7v7Btwf7ALD3/Kud3d2d/Z2v2M7nIKY+FiL3Msa+xFL/H8cS9X/NY9dP08+k/k363/92
/6Cm/52D/d1O/19ibG1t9Ur1syHLF1nM0CocTwQRy3iaccHj3MvDJGZhnCfs6JtvejhvmiVz5rrT
BczhrsvCeZpkOUszgIKnsY9Tegos4LdXizAKHFjNQfwu4Vdz7NMsuc68+YDNkwBgp8UHlw/YTb5M
+aDHHjIItpjk5gN24s35OSJgIp/n8n/3oegIGCYdx/DfDb9PM8JNH/K+5G2+BOlpTubLKLyqPHfo
gX6be9fiLsz92YBFybWSDRAaxtcaxPdE3uu5bCIheiAD9pbHyIENkAM27Y+J9m2cyMfMLjilpZyf
szDnWZ8NX7CTJOY9Av7p1AUoQAr/0wOgYlaSg5j7zBO4Oh8Xogmn9ECtwB2QQn9sCG7q3OFytgU6
t/q94h2P6nPP8mzV3B/Ca3j7dP38d6GoLy45QoFJKIIZKF777WshyPeW+bIiXuccBdw+9UWNwqqk
cGReKDg7FIJnaPmvsyzJSLClFk89MHK7TYmlla7RoiY0dZQl9AwC2RMB/1jqxICssuprsFYbTbbN
eKQpbzIehAJZ458288Hn6+xHOk6L/Si8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