#!/bin/bash
NEXTCLOUD_DIR="${NEXTCLOUD_DIR:-Nextcloud}";
INSTALL_FONTS="${INSTALL_FONTS}";
dir="${BASH_SOURCE%/*}";
pushd "$dir" > /dev/null;
. "../../Scripts/is-truthy.sh";

if isTruthy "$INSTALL_FONTS"
then
    # Microsoft Windows Fonts
    source "../Fonts/MicrosoftFonts/install.sh";
fi;

# Sync clouds
NEXTCLOUD_DIR="${NEXTCLOUD_DIR}" . "../rclone/InstallSync.sh" nextcloud "$NEXTCLOUD_DIR";

if isTruthy "$INSTALL_FONTS"
then
    # Install fonts
    NEXTCLOUD_DIR="${NEXTCLOUD_DIR}" source "../Fonts/NerdFont/install.sh";
fi;

source "../bash/oh-my-posh.sh";
source "../fish/oh-my-posh.sh";
NEXTCLOUD_DIR="${NEXTCLOUD_DIR}" source "../Oh My Posh/install.sh";

popd > /dev/null;