Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: include script to uninstall phpctl #45

Merged
merged 1 commit into from
Aug 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions docs/uninstall.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#!/usr/bin/env bash

INSTALL_DIR=~/.phpctl
SYMLINK_DIR=/usr/local/bin

LINKS=(
composer
composer-require-checker
co-phpunit
couscous
deptrac
exakat
frankenphp
infection
notty
pest
php
phpcbf
phpcs
php-cs-fixer
phpctl
phpmd
phpstan
phpunit
pint
rector
watchr
)

# Removing symlink
echo "Removing symbolic links..."
for link in "${LINKS[@]}"; do
if [ -L "${SYMLINK_DIR}/${link}" ]; then
sudo rm "${SYMLINK_DIR}/${link}"
echo "Removed ${SYMLINK_DIR}/${link}"
else
echo "Link ${SYMLINK_DIR}/${link} does not exist, skipping."
fi
done

# Opcional: removing directory
echo -e "\nDo you want to remove the installation directory (${INSTALL_DIR})? (Y/n) "
read -r answer
if [ "$answer" != "${answer#[Yy]}" ]; then
rm -rf "$INSTALL_DIR"
echo "Removed installation directory: ${INSTALL_DIR}"
else
echo "Skipping removal of installation directory."
fi

echo "Uninstallation complete."
Loading