-
-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add env variables and tdorc config options #10
Conversation
Can you please also add a section under usage in the README for this @idr4n |
Sure... done! @2KAbhishek |
@idr4n thanks for all the efforts on this, I left some suggestions I can do another round of review once you are done, since we are changing a lot of the code, we'll have to confirm that all the functions + tdo.nvim integrations work as expected with these changes lmk if you need any help |
@2KAbhishek Thanks for the comments. I will tackle them soon! However, before that, I was thinking whether we should use a different approach for templates, as it would modify to some extend the logic of this PR when creating new entries and new notes. Basically, I was thinking that it would be better to parse the template rather than just Now, to do the parsing, I suggest two options:
Let me know if you prefer this suggestion so I would implement it in this PR, or if we go as initially proposed here with your comments above.
Yes, definitely. I am using |
The template parsing idea seems really interesting, but to limit the scope of the changes on this PR, let's stick to configs only for now Unit tests will be nice, I have something in my mind for that, will open up a PR once I get some time |
Sound good. Will be working on the comments soon then.
Great, look forward to it! |
@2KAbhishek I have addressed the comments above. Hopefully there are not errors. I tested it both in interactive mode and in tdo.nvim. |
Thanks for the continued effort on this @idr4n, I left some final suggestions |
Do the config values behave the same way when used non interactively, e.g with tdo.nvim? |
to my understanding, technically [ $add_entry_timestamp = "true" ] and [ $add_entry_timestamp = true ] are the same, just trying to be consistent throughout. However, since $add_entry_timestamp is potentially set by the user, not sure what could be the behavior if set to some other string or command by the user. So just to avoid undesirable behavior, I explicitly compare against true, specially since you are suggesting to remove the
Yes, In the current code, the config values behave the same when used non interactively (that is, with tdo.nvim). |
You are suggesting: create_file "$note_file" "$template"
if [ ! -f "$note_file" ]; then
$filename_as_title && echo -e "# $1" >>"$note_file"
$add_new_note_timestamp && add_timestamp "$note_file" "$note_timestamp_format"
fi however, that condition will never be met as it runs after |
@idr4n just edited the suggestion, lmk what you think |
@2KAbhishek yes, the suggestion looks good. I have pushed the new suggested changes. |
@idr4n the changes look good, I did some cleanup, the only major change:
|
@2KAbhishek Awesome! Thanks a lot. |
What
What does this pull request accomplish?
Note that only one option can be used by the user. If one or more env variables are set, then the tdorc file is ignored.
How
What code changes were made to accomplish it?
config_setup
function to setup the config variables.new_note
andnew_entry
functions to allow for additional config options.Why
Additional Notes