state man. API && modularisation
- adds functions - util_create_state - util_read_state - util_write_state - util_delete_state for state management API. see docs/about_states.md for details. - moves functions from _reve.sh to _reve_utils.sh to prevent circular imports.
This commit is contained in:
50
install.sh
50
install.sh
@@ -4,48 +4,52 @@
|
||||
# Yigid BALABAN <fyb@fybx.dev> 2024
|
||||
|
||||
rt_script_dir=$(realpath "$(dirname "$0")")
|
||||
cd "$rt_script_dir" || exit
|
||||
cd "$rt_script_dir" || exit
|
||||
|
||||
reve_installation_target="$HOME/.local/bin/reve"
|
||||
|
||||
echo "[1/5] Creating reve installation folder"
|
||||
mkdir -p "$reve_installation_target"
|
||||
|
||||
echo "[2/5] Copying: reve.sh and _reve.sh"
|
||||
echo "[2/5] Copying: reve.sh and other internal tools"
|
||||
cp reve.sh "$reve_installation_target/reve"
|
||||
cp _reve.sh "$reve_installation_target/_reve"
|
||||
cp _reve_utils.sh "$reve_installation_target/_reve_utils"
|
||||
cp _reve_states.sh "$reve_installation_target/_reve_states"
|
||||
chmod +x "$reve_installation_target/reve"
|
||||
chmod -x "$reve_installation_target/_reve"
|
||||
chmod -x "$reve_installation_target/_reve_utils"
|
||||
chmod -x "$reve_installation_target/_reve_states"
|
||||
|
||||
echo "[3/5] Adding reve to path"
|
||||
if grep -q "/bin/bash" /etc/shells; then
|
||||
echo "==> bash detected."
|
||||
if ! grep -q "$reve_installation_target" ~/.bashrc; then
|
||||
echo "export PATH=\"\$PATH:$reve_installation_target\"" >> ~/.bashrc
|
||||
echo "Added $reve_installation_target to bash PATH."
|
||||
else
|
||||
echo "$reve_installation_target is already in bash PATH."
|
||||
fi
|
||||
echo "==> bash detected."
|
||||
if ! grep -q "$reve_installation_target" ~/.bashrc; then
|
||||
echo "export PATH=\"\$PATH:$reve_installation_target\"" >>~/.bashrc
|
||||
echo "Added $reve_installation_target to bash PATH."
|
||||
else
|
||||
echo "$reve_installation_target is already in bash PATH."
|
||||
fi
|
||||
fi
|
||||
|
||||
if grep -q "/bin/zsh" /etc/shells; then
|
||||
echo "==> zsh detected."
|
||||
if ! grep -q "$reve_installation_target" ~/.zshrc; then
|
||||
echo "export PATH=\"\$PATH:$reve_installation_target\"" >> ~/.zshrc
|
||||
echo "Added $reve_installation_target to zsh PATH."
|
||||
else
|
||||
echo "$reve_installation_target is already in zsh PATH."
|
||||
fi
|
||||
echo "==> zsh detected."
|
||||
if ! grep -q "$reve_installation_target" ~/.zshrc; then
|
||||
echo "export PATH=\"\$PATH:$reve_installation_target\"" >>~/.zshrc
|
||||
echo "Added $reve_installation_target to zsh PATH."
|
||||
else
|
||||
echo "$reve_installation_target is already in zsh PATH."
|
||||
fi
|
||||
fi
|
||||
|
||||
if grep -q "/bin/fish" /etc/shells; then
|
||||
echo "==> fish detected."
|
||||
if ! fish -c "echo $PATH | grep -q $reve_installation_target"; then
|
||||
fish -c "fish_add_path $reve_installation_target"
|
||||
echo "Added $reve_installation_target to fish PATH."
|
||||
else
|
||||
echo "$reve_installation_target is already in fish PATH."
|
||||
fi
|
||||
echo "==> fish detected."
|
||||
if ! fish -c "echo $PATH | grep -q $reve_installation_target"; then
|
||||
fish -c "fish_add_path $reve_installation_target"
|
||||
echo "Added $reve_installation_target to fish PATH."
|
||||
else
|
||||
echo "$reve_installation_target is already in fish PATH."
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "[4/5] Creating chores/mode folder"
|
||||
|
||||
Reference in New Issue
Block a user