Skip to content
This repository has been archived by the owner on Nov 15, 2022. It is now read-only.

Generate.sh script returns an error #5

Closed
thunderbiscuit opened this issue Feb 17, 2022 · 3 comments
Closed

Generate.sh script returns an error #5

thunderbiscuit opened this issue Feb 17, 2022 · 3 comments

Comments

@thunderbiscuit
Copy link
Member

After searching a bit, apparently realpath doesn't work inside scripts? Not sure why this is not throwing off the script; the wheel built fine on my end and my tests also worked.

generate.sh: line 5: zsh: command not found: realpath

It's failing yet still storing the right variable inside SCRIPT_DIR:

bdk-python on master [$!] via 🐍
❯ SCRIPT_DIR=$(dirname "$(realpath $0)")
zsh: command not found: realpath

bdk-python on master [$!] via 🐍
❯ echo $SCRIPT_DIR
.
@thunderbiscuit
Copy link
Member Author

@afilini do you know anything about this? It doesn't appear to create a problem on my end but it's still throwing an error, so I want to make sure it doesn't come and bite us later on.

For now the SCRIPT_DIR evaluates to ., is there a situation where you would need it to be something else?

@afilini
Copy link
Member

afilini commented Feb 18, 2022

I guess it just depends on your system, mine has a realpath binary so it also works in scripts, maybe other distros define it as an alias.

Try replacing it with readlink -f as suggested by that stackoverflow thread.

For now the SCRIPT_DIR evaluates to ., is there a situation where you would need it to be something else?

If you run the command from a different working directory it needs to adapt accordingly

@thunderbiscuit
Copy link
Member Author

Looking into this this morning and the simplest way seems to be to install coreutils using homebrew, which will bring in the realpath command.

brew install coreutils.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants