-
Notifications
You must be signed in to change notification settings - Fork 45
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
fix: set the exit code to the return of cd for the warp function #143
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📝 Leaving a few comments on changes from commits in another PR, but needed for the test_config
test to pass with the changed source
in tests!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
edfcd38
to
6054abe
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alpha-tango-kilo I just rebased it with the changes in #141 since these share a few testing changes needed for sourcing with WD_CONFIG
😅
Thanks once more for the review, and please let me know if more updates are needed! 🙏 ✨
test/tests.sh
Outdated
# confirm $WD_CONFIG was unchanged | ||
assertEquals "$wd_config_lines" "$(total_wps)" | ||
assertEquals "$wd_config_lines" 0 | ||
|
||
# confirm --config was changed | ||
assertEquals 1 "$(wcl < "$arg_config")" | ||
assertEquals 1 "$(WD_CONFIG=$arg_config total_wps)" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No changes to the asserts in this PR or the linked, but it's added for clarity as part of #141 🔬
6054abe
to
8eba879
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, thanks!
Summary
👋 🤠 This PR updates the exit code with the returned value from
cd
in thewd_warp
function to fix #142 and break chained commands if nested directories don't exist.Preview
With this change the exit code is set to
1
when a missing nested warp point is provided:Chained commands also break once the missing nested warp point is reached:
$ wd home unknown && ./setup.sh wd_warp:cd:19: no such file or directory: /home/user/unknown
Reviewers
To test the changes with this branch checked out, the following commands might be useful ✨
Notes
This change includes extra commits from #140 for some of the changes to testing. Please let me know if a rebase or other reverts are needed, or another change!