Taitava / obsidian-shellcommands

Execute system commands via hotkeys or command palette in Obsidian (https://obsidian.md). Some automated events are also supported, and execution via URI links.
GNU General Public License v3.0
348 stars 11 forks source link

Default values for variables #190

Closed Taitava closed 2 years ago

Taitava commented 2 years ago

Discussed in https://github.com/Taitava/obsidian-shellcommands/discussions/146

  • [x] Default values: if a custom variable does not yet have a value, a default value for it can be defined in each shell command's settings. Default values are shell command specific, so two shell commands can define different default values for the same variable.

  • [x] In addition to default values, add an option to silently cancel execution if the variable does not have a value. Maybe not so useful for custom variables, but will be good for built-in {{file_*}} variables when executing shell commands via events in a situation where no file is active, in which case the execution can be automatically cancelled without error messages.

I decided to create a separate issue for this feature in order to make it a bit more prominent, not just someting that happens to come along with other features. So it will also have a record in CHANGELOG.md. Being able to supress {{file_*}} variables' availability errors can be so handy in some cases (e.g. events) that it deserves a bit more attention.

Taitava commented 2 years ago

Beta 0.12.0-beta.1 was released yesterday. Following commits will go into a second beta version.

Edit 2022-05-07: No second beta was made, the commits are included in the normal 0.12.0 release.

Taitava commented 2 years ago

Released.