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

Streamlining Setup: Introducing a Makefile for Effortless Dependency Management and Installation #15

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

ashish-kus
Copy link

Wanted to contribute to this awesome project. I've replaced the install and uninstall scripts with a MAKEFILE to handle dependency checks and installations, ensuring a smoother user experience and for better management. I've made some updates to the README to reflect the changes I've introduced.

Installation: make install
Uninstallation: make uninstall

Please review and share your thoughts. Thanks!

# Define the dependencies
DEPENDENCIES = chafa convert jq curl

# Define the installation directories
INSTALL_DIR = /usr/local

# Installation instructions
install: check_dependencies
	@echo "\033[1;32m Installing... \033[0m"
	sudo mkdir -pv $(INSTALL_DIR)
	sudo cp -rv bin $(INSTALL_DIR)
	sudo cp -rv share $(INSTALL_DIR)
	@echo "Installation complete."
	@echo "updating your $PATH variable"

	@echo -e "\033[1;32m DONE \033[0m pokeshell is now installed"
	@echo -e "\033[1;32m RELOAD YOUR SHELL BEFORE USING POKESHELL \033[0m"

# Uninstallation instructions
uninstall:
	@echo "Uninstalling..."

	@echo "Removing files"	 
	sudo rm -rf $(INSTALL_DIR)/bin/pokeshell
	@echo "Removing Complitions"
	sudo rm -rf $(INSTALL_DIR)/share/bash-completion/completions/pokeshell

	@echo -e "Removing directories "
	sudo rmdir -v $(INSTALL_DIR)/bin
	sudo rmdir -v $(INSTALL_DIR)/share/bash-completion/completions
	sudo rmdir -v $(INSTALL_DIR)/share/bash-completion

	@echo -e "\033[1;31m pokeshell uninstalled \033[1;32m OK \033[0m"

# Target to check dependencies
check_dependencies:
	@echo "Checking dependencies..."
	@for dep in $(DEPENDENCIES); do \
		command -v $$dep >/dev/null 2>&1 || { echo "$$dep is required but not installed. Aborting."; exit 1; }; \
	done


.PHONY: install uninstall check_dependencies

@ashish-kus ashish-kus changed the title Replace Install and Uninstall Scripts with MAKEFILE for Improved Management. Streamlining Setup: Introducing a Makefile for Effortless Dependency Management and Installation Sep 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant