From 2b8f2a7e7ed5876f747085dbb6cd8be37a0c03ae Mon Sep 17 00:00:00 2001 From: Unbewohnte Date: Mon, 21 Aug 2023 20:56:32 +0300 Subject: [PATCH] Distribution: installation via make or install.sh; docs: updated README --- Makefile | 6 +++++- README.md | 2 ++ install.sh | 12 ++++++++++-- src/main.c | 4 ++-- 4 files changed, 19 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index ef40e1f..b9cbbb7 100644 --- a/Makefile +++ b/Makefile @@ -6,6 +6,10 @@ clean: install: all mv clido /usr/local/bin + mkdir -p /usr/local/share/clido + touch /usr/local/share/clido/TODOS.bin + chmod -R a+rw /usr/local/share/clido delete: - rm -f /usr/local/bin/clido \ No newline at end of file + rm -rf ~/.clido + sudo rm -rf /usr/local/bin/clido \ No newline at end of file diff --git a/README.md b/README.md index c235b9a..d9181b6 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,8 @@ Simply `make` or as simply compile .c files together If you're on Linux - `sudo make install` **or** `sudo ./install.sh` **or if not** simply move the binary to wherever you desire. +On Windows clido will look for a todo file in the current directory, on other platforms it will be /usr/local/share/clido (which is created and configured automatically via `make install` or `install.sh`) + ## Usage `clido [COMMAND]` diff --git a/install.sh b/install.sh index 6014e14..06c4c8d 100755 --- a/install.sh +++ b/install.sh @@ -1,9 +1,17 @@ program=clido target=/usr/local/bin +todo_target=/usr/local/share/clido + if [ -f "$program" ]; then - echo "Moving $program to $target ..." - mv $program $target && echo "Successfully installed!" + echo "Creating $todo_target ..." + mkdir -p $todo_target && \ + touch $todo_target/TODOS.bin && \ + echo "Setting rights ..." && \ + chmod -R a+rw $todo_target && \ + echo "Moving $program to $target ..." && \ + mv $program $target && \ + echo "Successfully installed!" else echo "$program does not exist!" fi \ No newline at end of file diff --git a/src/main.c b/src/main.c index 2bf87b1..c209082 100644 --- a/src/main.c +++ b/src/main.c @@ -26,14 +26,14 @@ #include "todo.h" -#define CLIDO_VERSION "0.1" +#define CLIDO_VERSION "0.1.1" #ifdef _WIN32 #define TODO_FILE_PATH "TODOS.bin" #else -#define TODO_FILE_PATH "/usr/local/share/TODOS.bin" +#define TODO_FILE_PATH "/usr/local/share/clido/TODOS.bin" #endif