Closed kiil closed 1 year ago
Would an alias work for you?
[alias]
newdir = "mkdir -p $1;zk new $@"
The only limitation is that you need to pass the dir as the first argument, and the flags after.
zk newdir existing_dir/new_dir --title "testtitle"
Nice solution!
This does not seem to work with more than one word in the title.
With:
SHELL=/usr/bin/sh
ZK_SHELL=/usr/bin/sh
The following
sh-5.1$ zk newdir tst/test --title='word1 word2'
Gives
zk: error: unexpected argument word2
This seems to be a general problem with aliases.
Given
[alias]
n = "zk new $@"
The command
sh-5.1$ zk n testdir --title='one two'
gives
zk: error: unexpected argument two
Can be solved like so:
newdir = 'mkdir -p $1;zk new "$@"'
I am using zk with hugo cms.
Hugo has a concept of page bundles, where a bundle lives in its own (sub)directory.
But currently, as I understand it, zk cannot create a directory.
For example:
will make zk respond
zk: error: new note: existing_dir/new_dir: directory not found
My feature request is to have an option configurable in the config file and as a command line option to enable zk to create directories.