Change {{folder_name}} and {{event_folder_name}} to return a dot instead of an empty string #237
Taitava
started this conversation in
Ideas - done & released
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Currently, if a note is located in the vault's root folder, and a shell command like
echo {{folder_name}}
is executed, then the value of{{folder_name}}
is an empty text.I'm planning to change the value to be a dot
.
when the folder in question is the vault's root folder. This is a breaking change, unfortunately. (If the folder is not the vault's root, then nothing will change).Examples of situations that are currently problematic:
{{folder_name}}
is just one part of it, e.g.echo "Content" > {{folder_name}}/NewNote.md
echo "Content" > /NewNote.md
Creates a file to the file system root, outside of the Obsidian vault.
echo "Content" > ./NewNote.md
Creates a file correctly in the current working directory, i.e. usually the vault's root folder.
cp -r {{folder_name}} /absolute/path/for/new/folder/outside/of/the/vault
cp -r /absolute/path/for/new/folder/outside/of/the/vault
The first argument to
cp
is omitted because it was empty.cp -r . /absolute/path/for/new/folder/outside/of/the/vault
The first argument is correctly
.
so it's not accidentally omitted.Variables affected by the change
{{folder_name}}
{{event_folder_name}}
Variables that already give a dot
.
in similar situations{{folder_path:relative}}
{{event_folder_path:relative}}
{{new_note_folder_name}}
{{new_note_folder_path}}
As there are already variables that give a dot
.
for the root folder, this change will streamline the behavior.Beta Was this translation helpful? Give feedback.
All reactions