mirror of
https://github.com/tomasriveral/NoteWrapper.git
synced 2026-08-12 02:18:38 +02:00
Created makefile
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
config file in json
|
||||
|
||||
requierements neovim, nvim-tree, vivify, vivify.vim
|
||||
requierements neovim vivify, vivify.vim, ncurses, cjson, pkg-config,
|
||||
|
||||
1. launches a TUI
|
||||
- asks if you want to open an already existing directory (by default in ~/Documents/Notes but can be changed in the config file) or create a new directory
|
||||
|
||||
@@ -1,35 +1,17 @@
|
||||
# Makefile for the Notes Vault project
|
||||
|
||||
# Compiler
|
||||
CC = gcc
|
||||
|
||||
# Source files
|
||||
SRC = startup.c
|
||||
|
||||
# Output binary
|
||||
TARGET = nvimnotes
|
||||
|
||||
# Compiler flags
|
||||
CFLAGS = -Wall -O2 `pkg-config --cflags libcjson ncurses`
|
||||
|
||||
# Linker flags
|
||||
LDFLAGS = `pkg-config --libs libcjson ncurses`
|
||||
|
||||
# Debug mode
|
||||
DEBUG ?= 0
|
||||
ifeq ($(DEBUG),1)
|
||||
CFLAGS += -g
|
||||
CFLAGS += -g
|
||||
endif
|
||||
|
||||
.PHONY: all clean run
|
||||
|
||||
all: $(TARGET)
|
||||
|
||||
$(TARGET): $(SRC)
|
||||
$(CC) $(CFLAGS) $^ -o $@ $(LDFLAGS)
|
||||
|
||||
run: $(TARGET)
|
||||
./$(TARGET)
|
||||
|
||||
clean:
|
||||
rm -f $(TARGET)
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
pkgs.mkShell {
|
||||
buildInputs = [
|
||||
pkgs.vivify
|
||||
pkgs.cjson
|
||||
pkgs.ncurses
|
||||
pkgs.pkg-config
|
||||
|
||||
@@ -256,7 +256,7 @@ int main(int argc, char *argv[]) {
|
||||
char *vaultSelected = ncursesSelect(vaultsArray, "vault", vaultsCount + extraOptions, debug);
|
||||
if (debug) {printf("\e[0;32m[DEBUG]\e[0m Selected vault:%s\n", vaultSelected);}
|
||||
|
||||
if (vaultSelected != "Create a new vault" && vaultSelected != "Settings" && vaultSelected != "Quit (Ctrl+C)") {
|
||||
if (strcmp(vaultSelected,"Create a new vault") != 0 && strcmp(vaultSelected,"Settings") != 0 && strcmp(vaultSelected,"Quit (Ctrl+C)") != 0) {
|
||||
int shouldChangeVault = 0;
|
||||
while (!shouldExit && !shouldChangeVault) {
|
||||
// this loop is the note selector
|
||||
@@ -280,25 +280,25 @@ int main(int argc, char *argv[]) {
|
||||
char *noteSelected = ncursesSelect(filesArray, "note", filesCount + extraNotesOptions, debug);
|
||||
if (debug) {printf("\e[0;32m[DEBUG]\e[0m Selected note: %s\n", noteSelected);}
|
||||
|
||||
if (noteSelected != "Create new note" && noteSelected != "Back to vault selection" && noteSelected != "Quit (Ctrl+C)") {
|
||||
if (strcmp(noteSelected, "Create new note") != 0 && strcmp(noteSelected,"Back to vault selection") != 0 && strcmp(noteSelected,"Quit (Ctrl+C)") != 0) {
|
||||
char fullPath[PATH_MAX];
|
||||
sprintf(fullPath, "%s/%s/%s", notesDirectoryString, vaultSelected, noteSelected);
|
||||
openNvim(fullPath, debug);
|
||||
} else if (noteSelected == "Create new note") {
|
||||
} else if (strcmp(noteSelected,"Create new note") == 0) {
|
||||
|
||||
} else if (noteSelected == "Back to vault selection") {
|
||||
} else if (strcmp(noteSelected,"Back to vault selection") == 0) {
|
||||
shouldChangeVault = 1;
|
||||
} else if (noteSelected == "Quit (Ctrl+C)") {
|
||||
} else if (strcmp(noteSelected,"Quit (Ctrl+C)") == 0) {
|
||||
if (debug) {printf("\e[0;32m[DEBUG]\e[0m The program was exited,\n");}
|
||||
shouldExit = 1;
|
||||
}
|
||||
}
|
||||
|
||||
} else if (vaultSelected == "Create a new vault") {
|
||||
} else if (strcmp(vaultSelected,"Create a new vault") == 0) {
|
||||
|
||||
} else if (vaultSelected == "Settings") {
|
||||
} else if (strcmp(vaultSelected,"Settings") == 0) {
|
||||
//(TODO LATER) add a way to change the config.json from the app or at least show all the options
|
||||
} else if (vaultSelected == "Quit (Ctrl+C)") {
|
||||
} else if (strcmp(vaultSelected,"Quit (Ctrl+C)") == 0) {
|
||||
if (debug) {printf("\e[0;32m[DEBUG]\e[0m The program was exited.\n");}
|
||||
shouldExit = 1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user