#!/bin/bash

## Copyright (C) 2012 - 2025 ENCRYPTED SUPPORT LLC <adrelanos@whonix.org>
## See the file COPYING for copying conditions.

set -x
set -e
set -o pipefail
set -o errtrace

true "INFO: Currently running script: $BASH_SOURCE $@"

build_all_error_handler() {
   : echo "
${red}${bold}BASH_COMMAND${reset}: $BASH_COMMAND
${red}${bold}ERROR $BASH_SOURCE: | caller: $(caller)${reset}
"
   exit 1
}

trap "build_all_error_handler" ERR
set +e

MYDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

cd "$MYDIR"

## XXX: hardcoded path
cd "$HOME/derivative-maker"

## Debugging.
pwd

if [ "$(id -u)" = "0" ]; then
   error "Do not run this as root!"
fi

./derivative-update --tag latest

## Informational.
git describe
