-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
36 lines (28 loc) · 937 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
.PHONY: all install venv config bin uninstall
APP_NAME = ShellQuick
CONFIG_DIR = $(HOME)/.config/shellquick
CONFIG_FILE = $(CONFIG_DIR)/config.yml
INSTALL_DIR = /usr/local/bin
RUN_SCRIPT = $(INSTALL_DIR)/$(APP_NAME)
VENV_DIR := venv
all: install
install: venv config bin
venv:
@echo "Setting up virtual environment..."
python3 -m venv venv
venv/bin/pip install -r requirements.txt
config:
@echo "Creating configuration directory and copying default config..."
mkdir -p $(CONFIG_DIR)
cp config.yml $(CONFIG_FILE)
bin:
@echo "Creating run script and place in /usr/local/bin..."
echo "#!/bin/bash\nsource $(PWD)/venv/bin/activate\npython $(PWD)/app.py 2>&1 2>/dev/null &" > shellquick_run.sh
chmod +x shellquick_run.sh
sudo cp shellquick_run.sh $(RUN_SCRIPT)
uninstall:
@echo "Stopping and unloading the ShellQuick service..."
sudo rm -f $(RUN_SCRIPT)
rm -rf $(CONFIG_DIR)
rm -rf $(VENV_DIR)
rm -rf shellquick_run.sh