Skip to content
Merged
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
12 changes: 7 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
name: test

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

Expand All @@ -22,10 +20,14 @@ jobs:
pkg-config \
libcjson-dev \
libncurses-dev \
git

git \
neovim
- name: Prepare environnement
run: mkdir -p ~/Documents/Notes
- name: Build
run: make

- name: Run tests
run: make test
run: |
export TERM=xterm
make test
14 changes: 11 additions & 3 deletions src/utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,17 +112,25 @@ static void ensureDir(const char *path, const int shouldDebug) {
}

void initAppFilesAndDirs(const char *home, const int shouldDebug) {
// sometimes .cache and .config doesn't exist. Such as with github actions machines
char config_dir[PATH_MAX];
char cache_dir[PATH_MAX];

snprintf(config_dir, sizeof(config_dir),
"%s/.config/notewrapper", home);
"%s/.config/", home);

snprintf(cache_dir, sizeof(cache_dir),
"%s/.cache/notewrapper", home);
"%s/.cache/", home);

ensureDir(config_dir, shouldDebug);
ensureDir(cache_dir, shouldDebug);

strncat(config_dir, "notewrapper/", PATH_MAX);
strncat(cache_dir, "notewrapper/", PATH_MAX);

ensureDir(config_dir, shouldDebug);
ensureDir(cache_dir, shouldDebug);


char config_file[PATH_MAX+12];
snprintf(config_file, sizeof(config_file), "%s/config.json", config_dir);
Expand Down
Loading