Skip to content

Commit c9fc73f

Browse files
committed
added uninstallation
1 parent 8fda627 commit c9fc73f

File tree

3 files changed

+27
-1
lines changed

3 files changed

+27
-1
lines changed

format_cpl_jlc.sh

100755100644
File mode changed.

install_devices_helpers.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
SCRIPT_DIR=$(realpath "./")
44
SHELL_CONFIG="$HOME/.bashrc"
55

6-
# add support for .bashrc and if neither file exist
6+
# TODO: add support for .bashrc and if neither file exist
77
if [ "$SHELL" == "/bin/zsh" ]; then
88
SHELL_CONFIG="$HOME/.zshrc"
99
fi

uninstall_devices_helpers.sh

100644100755
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/bin/bash
2+
3+
4+
SCRIPT_DIR=$(realpath "./")
5+
SHELL_CONFIG="$HOME/.bashrc"
6+
7+
if [ "$SHELL" == "/bin/zsh" ]; then
8+
SHELL_CONFIG="$HOME/.zshrc"
9+
fi
10+
11+
SCRIPT_PATH_CPL_JLC="./format_cpl_jlc.sh"
12+
SCRIPT_NAME_CPL_JLC=$(basename "$SCRIPT_PATH_CPL_JLC")
13+
14+
chmod -x "$SCRIPT_PATH_CPL_JLC"
15+
16+
# Remove the script's directory from PATH in the shell configuration
17+
if grep -q "export PATH=\"$SCRIPT_DIR" "$SHELL_CONFIG"; then
18+
sed -i "\|export PATH=\"$SCRIPT_DIR|d" "$SHELL_CONFIG"
19+
echo "Removed $SCRIPT_DIR from PATH in $SHELL_CONFIG."
20+
PATH=$(echo "$PATH" | sed -e "s|$SCRIPT_DIR:||" -e "s|:$SCRIPT_DIR||") # Update current session
21+
echo "Temporary PATH updated for this session."
22+
else
23+
echo "Directory $SCRIPT_DIR not found in $SHELL_CONFIG."
24+
fi
25+
26+
echo "Uninstallation complete."

0 commit comments

Comments
 (0)