Compare commits

...
Author SHA1 Message Date
github-actions[bot] 84d3c9bd85 chore(release): 2.1 2026-05-25 14:57:19 +00:00
tomasrandGitHub 6e6ddebb5e Merge (#29) from tomasriveral/workflows
CI: add weeklyUpdate workflow
2026-05-25 16:56:13 +02:00
tomasrandGitHub 91d6db6c74 Merge (#28) from tomasriveral/flake.nix
flake: init
2026-05-25 16:46:57 +02:00
tomasrandGitHub f85a32f97f Merge pull request #27 from tomasriveral/tomasriveral-patch-1
docs: fix typo in readme
2026-05-23 18:26:26 +02:00
tomasrandGitHub bc306ca630 docs: fix typo in readme 2026-05-23 16:26:07 +00:00
tomasrandGitHub 89c686652e Merge pull request #26 from tomasriveral/readme-message
docs: add message in readme
2026-05-23 18:25:25 +02:00
tomasrandGitHub 8ee0096540 Merge (#25) from tomasriveral/fix-contributing
docs: fix forgot to update function name
2026-05-02 08:50:37 +02:00
tomasrandGitHub 2d6787a91b Merge (#24) from tomasriveral/fixJournalCreation fix (#21)
journal: fix (#21)
2026-05-02 08:21:51 +02:00
tomasr 2f688df3ec journal: fix crash when creating unified journal without ".md" 2026-05-02 08:18:46 +02:00
3 changed files with 11 additions and 11 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
# NoteWrapper # NoteWrapper
Note: This project fullfills all my usecase for now, so my main source for features ideas dried out. So if you have good ideas, feel free to open an issue ;) Note: This project fullfills all my usecases for now, so my main source for features ideas dried out. So if you have good ideas, feel free to open an issue ;)
[![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/tomasriveral/notewrapper) [![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/tomasriveral/notewrapper)
+1 -1
View File
@@ -13,7 +13,7 @@
in { in {
packages.default = pkgs.stdenv.mkDerivation (finalAttrs: { packages.default = pkgs.stdenv.mkDerivation (finalAttrs: {
pname = "notewrapper"; pname = "notewrapper";
version = "2.0"; version = "2.1";
src = pkgs.fetchFromGitHub { src = pkgs.fetchFromGitHub {
owner = "tomasriveral"; owner = "tomasriveral";
+9 -9
View File
@@ -130,16 +130,16 @@ char *createNewNote(char dirToVault[PATH_MAX], char *vaultFromDir, int bypass, c
free(fileFullPath); free(fileFullPath);
} else { // if it is a unified journal } else { // if it is a unified journal
char *fileFullPath = malloc(PATH_MAX); char *fileFullPath = malloc(PATH_MAX);
snprintf(fileFullPath, PATH_MAX, "%s/%s/%s", dirToVault, vaultFromDir, fileName); // we append .md directly to fileName and not only to fileFullPath to avoid passing the wrong fileName later.
int len = strlen(fileFullPath); int lenName = strlen(fileName);
if (fileFullPath[len - 3] != '.' || fileFullPath[len - 2] != 'm' || fileFullPath[len - 1] != 'd') { // there might be a cleaner way to do this if (fileName[lenName - 3] != '.' && fileName[lenName - 2] != 'm' && fileName[lenName - 2] != '1') {
error(len > PATH_MAX - 3, "user", "%s is too big (greater than PATH_MAX-3) and we can't append .md", fileFullPath); strcat(fileName, ".md");
strncat(fileFullPath, ".md", PATH_MAX); debug("We just appended .md to %s", fileName);
// we checked before if fileName didn't already exist.
// we must redo it as we add a .mode
struct stat st;
error(stat(fileFullPath, &st) == 0, "user", "%s already exists", fileFullPath);
} }
snprintf(fileFullPath, PATH_MAX, "%s/%s/%s", dirToVault, vaultFromDir, fileName);
// we verify if the file doesn't already exist as we might just have changed the fileName and (by extension) the file path.
struct stat metadata;
error(stat(fileFullPath, &metadata) == 0, "user", "%s already exists", fileFullPath);
FILE *filePointer; FILE *filePointer;
filePointer = fopen(fileFullPath, "w"); // creates and opens the file filePointer = fopen(fileFullPath, "w"); // creates and opens the file
error(filePointer == NULL, "program", "The %s couldn't be created.", fileFullPath); error(filePointer == NULL, "program", "The %s couldn't be created.", fileFullPath);