Go into setup mode if running outside a Bazel workspace
note for later (maybe a TODO?) we should offer to help if the user actually meant the cwd to be a workspace - go interactive and into a setup mode
Originally posted by @alexeagle in https://github.com/aspect-build/aspect-cli/pull/83#discussion_r767176209
It's sometimes useful to just run an executable to ensure it's been installed and is working properly, but as of v0.5.0, there's no command that simply runs and succeeds without being inside of a Bazel workspace. It would be nice if aspect version, aspect help, or really any command would return a success code when run from any folder.
@stabai I can see that those commands should not depend on being inside a valid Bazel workspace. On the other hand, if you want to check if an executable is installed correctly, the canonical way is to verify its checksum hash. You can additionally call which <program>, which (no pun intended) would tell you the program also got the right permission flags.
True, but those sorts of checks can't answer a few things:
- Is the executable permission set on the file (often not right after download)?
- Is the file in quarantine by macOS (often true right after download)?
- Is the application able to access any dependent libraries that are required?
The reason I'm thinking about it this way is that I need to automate this check. Currently, the best way seems to be the following:
- Create a
WORKSPACEfile in a directory - Run
aspect versionfrom that directory - Delete the
WORKSPACEfile
This is in some ways the most realistic way to verify the application is working, since it tests it against a valid environment. However, I'm not in love with creating and deleting files to do it.