Skip to content
Open
Show file tree
Hide file tree
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
44 changes: 44 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Define the dependencies
DEPENDENCIES = chafa convert jq curl
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

convert should be imagemagick I believe.


# 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)
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are sudo commands necessary inside the Makefile? I believe these should be left out and if the INSTALL_DIR requires admin privileges then the user can call sudo make install/uninstall, right?

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"
Comment on lines +14 to +17
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This script is not updating the $PATH as far as I can tell, please remove line 14. Since it is not updating the $PATH, reloading will not do anything. pokeshell will work as long as $(INSTALL_DIR)/bin is on path.


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

@echo "Removing files"
sudo rm -rf $(INSTALL_DIR)/bin/pokeshell
@echo "Removing Complitions"
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spelling

sudo rm -rf $(INSTALL_DIR)/share/bash-completion/completions/pokeshell
Comment on lines +24 to +26
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the -r flag is doing nothing here as these are files
the -f flag is not needed anyway either I think, can you explain where the current invocation will fail (just rm) compared to rm -f?
Also I'd like to keep the -v flag for being transparent with users. Shellscripts shouldn't be trusted willy-nilly from the internet and -v makes what we are removing on their filesystem clear.


@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

15 changes: 9 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,21 @@ Key features include:

## Installation

You can install pokeshell system-wide with the `install.sh` script like so:
You can install pokeshell system-wide with the `make install` command like so:
```bash
sudo ./install.sh
make install
```

This will allow you to run `pokeshell` anywhere on your system as well as add
shell completions.

An uninstall script is also provided:
An uninstalltion is also provided:
Comment on lines +24 to +26
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

spelling

```bash
sudo ./uninstall.sh
make uninstall
```

If you do not want to install then you can still run pokeshell anywhere
by adding the following lines to your `~/.bashrc`.
by just colning the repo and adding the path to repo to your $PATH variable by adding the following lines to your `~/.bashrc`.
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

spelling, use backticks around $PATH.


```bash
export PATH=/path/to/pokeshell:$PATH
Expand All @@ -38,7 +38,10 @@ export PATH=/path/to/pokeshell:$PATH
## Usage

```bash
pokeshell --help

pokeshell -a random s:pikachu-gmax"

for more options $ pokeshell --help
Comment on lines -41 to +44
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove the example here, that is what --help is for.

```

or if running from this directory:
Expand Down
5 changes: 0 additions & 5 deletions install.sh

This file was deleted.

8 changes: 0 additions & 8 deletions uninstall.sh

This file was deleted.