Added install and run scripts

This commit is contained in:
Kyattsukuro 2026-03-17 17:00:20 +01:00
parent b5c6cbaade
commit 65d8ebce17
2 changed files with 28 additions and 0 deletions

22
install.sh Executable file
View File

@ -0,0 +1,22 @@
#!/usr/share/env bash
# Target dir is config vecause this will never include binary blops
TARGET_DIR="$HOME/.config/fledermaus-formatter"
if [ -d $TARGET_DIR ]; then
rm -rf "${TARGET_DIR}"
fi
mkdir -p $TARGET_DIR
git clone git@git.urmel.de:Kyattsukuro/fledermaus.git "$TARGET_DIR"
python -m venv $TARGET_DIR/.venv
source $TARGET_DIR/.venv/bin/activate
pip install -r $TARGET_DIR/requirements.txt
mkdir -p $HOME/.local/share/bin/
rm -r $HOME/.local/share/bin/fledermaus-formater > /dev/zero
ln -s $TARGET_DIR/run.sh ~/.local/share/bin/fledermaus-formater
if [[ ":$PATH:" != *":$HOME/.local/share/bin:"* ]]; then
echo 'export PATH="$HOME/.local/share/bin:$PATH"' >> ~/.bashrc
export PATH="$HOME/.local/share/bin:$PATH"
fi

6
run.sh Executable file
View File

@ -0,0 +1,6 @@
#!/usr/bin/env bash
SCRIPT_DIR="$HOME/.config/fledermaus-formatter"
cd $SCRIPT_DIR
python __init__.py $@