Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/avamsi/rd
rd is a hacky? magical? recursive cd
https://github.com/avamsi/rd
cli golang
Last synced: about 1 month ago
JSON representation
rd is a hacky? magical? recursive cd
- Host: GitHub
- URL: https://github.com/avamsi/rd
- Owner: avamsi
- License: unlicense
- Created: 2023-01-30T11:28:30.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-09-26T16:28:43.000Z (over 1 year ago)
- Last Synced: 2024-10-20T20:22:05.572Z (3 months ago)
- Topics: cli, golang
- Language: Go
- Homepage:
- Size: 11.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
```
$ go install github.com/avamsi/rd@latest
``````shell
cd() {
# Keep the original cd error hidden for if rd succeeds below.
builtin cd $@ 2>/tmp/rd-cde || {
# Note: don't try to "fix" this by adding `local`, it doesn't work.
# For whatever reason, the `&&` chaining behaviour is lost with it.
d=$(rd $@) && builtin cd $d || {
# No luck, show the original error as well.
cat /tmp/rd-cde
return 1
}
}
}
```