Files
linux-workspace/install.sh
2025-10-09 10:35:20 +02:00

28 lines
826 B
Bash
Executable File

#!/usr/bin/env bash
set -E -o errexit -o nounset -o pipefail
function install_lws() {
local LWS_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P)
if grep -q -e "source.*$LWS_DIR/bashrc" $HOME/.bashrc; then
echo "SKIP: Linux Workspace configuration already exists in .bashrc !"
else
echo "Adding to $HOME/.bashrc"
echo "source '$LWS_DIR/bashrc'" >> "$HOME/.bashrc"
fi
if [[ -d $HOME/.config/fish/ ]]; then
if [[ -f $HOME/.config/fish/config.fish ]]; then
echo "SKIP: Linux Workspace configuration already exists in fish config !"
else
echo "Adding to $HOME/.config/fish/conf.d/lws.fish"
echo "source $LWS_DIR/fishrc" > $__fish_config_dir/conf.d/lws.fish
fi
else
echo "Fish configuration directory not found, skipping fish setup."
fi
}
install_lws