2020-08-17 03:03:32 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -eu
|
|
|
|
set -o pipefail
|
|
|
|
|
2020-08-21 03:15:33 +02:00
|
|
|
source path-scripts
|
|
|
|
|
2020-08-17 03:03:32 +02:00
|
|
|
XDG_DATA_HOME="${XDG_DATA_HOME:-$HOME/.local/share}"
|
|
|
|
tvlc_root="$XDG_DATA_HOME/tvlc"
|
|
|
|
|
2020-08-21 03:15:33 +02:00
|
|
|
nice_checkout_root=
|
2020-08-17 03:03:32 +02:00
|
|
|
if [ -f "$tvlc_root"/nice_checkout_root ]; then
|
|
|
|
nice_checkout_root="$(cat "$tvlc_root"/nice_checkout_root)"
|
|
|
|
fi
|
|
|
|
nice_checkout_root="${nice_checkout_root:-$HOME/tvlc}"
|
|
|
|
|
|
|
|
depot_root=
|
|
|
|
if [ -f "$tvlc_root/depot_root" ]; then
|
|
|
|
depot_root="$(cat "$tvlc_root/depot_root")"
|
|
|
|
fi
|
|
|
|
if [ -d /depot ]; then
|
|
|
|
# don't require config on tvl nixos servers
|
|
|
|
depot_root="${depot_root:-/depot}"
|
|
|
|
fi
|
|
|
|
if [ -n "$depot_root" ]; then
|
|
|
|
export DEPOT_ROOT="$depot_root"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ ! -d "$tvlc_root" ]; then
|
|
|
|
echo "tvlc: setup required"
|
|
|
|
echo "please run 'tvlc setup' from the depot root"
|
|
|
|
exit 1
|
|
|
|
fi
|