set -e
set -u
set -f
_program_path_find()
{
if [ "${_program_fattening_program_path+set}" = 'set' ]; then
printf '%s\n' "$_program_fattening_program_path"
elif [ "${0%/*}" = "$0" ]; then
if [ -r "$0" ]; then
pwd -P
else
printf '\n'
fi
else
_program_path_find_parentPath()
{
parentPath="${scriptPath%/*}"
if [ -z "$parentPath" ]; then
parentPath='/'
fi
cd "$parentPath" 1>/dev/null
}
if [ "${CDPATH+set}" = 'set' ]; then
unset CDPATH
fi
if command -v realpath 1>/dev/null 2>/dev/null; then
(
scriptPath="$(realpath "$0")"
_program_path_find_parentPath
pwd -P
)
elif command -v readlink 1>/dev/null 2>/dev/null; then
(
scriptPath="$0"
while [ -L "$scriptPath" ]
do
_program_path_find_parentPath
scriptPath="$(readlink "$scriptPath")"
done
_program_path_find_parentPath
pwd -P
)
else
(
scriptPath="$0"
_program_path_find_parentPath
pwd -P
)
fi
fi
}
recreate_bindings_main()
{
local programPath="$(_program_path_find)"
cd "$programPath"/../.. 1>/dev/null 2>/dev/null
local homeFolder="$(pwd)"
cd - 1>/dev/null 2>/dev/null
cd "$homeFolder" 1>/dev/null 2>/dev/null
rm -rf src/bindgen
rm -rf bindgen-wrapper.conf.d/temporary
cargo clean
rm -rf target ../target
tools/bindgen-wrapper/cargo-musl-wrapper build
}
recreate_bindings_main "$@"