Extend _GIT_ENABLED Support to Note/Todo Deletions in nb CLI #290
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces an enhancement to the
nb
CLI's handling of note and todo deletions, specifically in the context of the_GIT_ENABLED
environment variable. Thenb
CLI already incorporates the_GIT_ENABLED
variable, which, when set to a non-empty string, disables the use of GIT for its operations. This change extends that functionality to the deletion process of notes and todos.Key Changes:
Conditional Git Command Execution: The script has been adjusted to conditionally execute git commands based on the
_GIT_ENABLED
variable. When this variable is set to an empty string, indicating GIT functionality is enabled, the script will execute git-specific commands. Conversely, if_GIT_ENABLED
is not empty, these commands are bypassed.Maintained Original Functionality: Outside the scope of the
_GIT_ENABLED
variable, the original functionality of the script remains unchanged. This ensures that existing workflows are not disrupted by this update.Impact:
This change enhances the
nb
CLI's flexibility and control in environments where GIT usage might be restricted or not preferred. It allows users to leverage the full capabilities ofnb
without relying on GIT, aligning with scenarios where a simpler or more streamlined workflow is desired.Testing:
_GIT_ENABLED
is an empty string, to ensure that GIT commands execute as expected._GIT_ENABLED
is set to a non-empty string, confirming that GIT commands are appropriately skipped.This update is a step forward in making the
nb
CLI more adaptable to various user environments and preferences. Your review and feedback on this implementation are highly appreciated.