Displaying error messages #1379
-
Is there a way to display error messages for instance when someone tries to use my script without having Git installed I would want to stop the process and display an error that git is required. I know in this case I could do a number of things such as check for homebrew or some other installer and ask to install but then there is a lot of logic branching that I would want to avoid. Currently I just want to display an error message in Script Kit or something |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Error messages should be improved in the 2.0 release candidate: https://github.com/johnlindquist/kitapp/releases/tag/v1.99.79 (Using "grit" instead of "git" for testing purposes) let hasGrit = await isBin("grit")
if (hasGrit) {
// Do grit stuff
} else {
throw Error("You need to install grit")
} Or if you want to provide much more info: let hasGrit = await isBin("grit")
if (hasGrit) {
// Do grit stuff
} else {
let message = md(`# Grit Not Found
The \`grit\` command was not found on your PATH accessible in this script.
Please check \`grit\` is installed.
Options:
- Add PATH variable in ~/.kenv/.env
- Modify this script to use the full path to \`grit\`
Click [here](https://google.com) to learn more about grit.
`)
await div(message)
} |
Beta Was this translation helpful? Give feedback.
@josephcrawfordSRH
Error messages should be improved in the 2.0 release candidate:
https://github.com/johnlindquist/kitapp/releases/tag/v1.99.79
(Using "grit" instead of "git" for testing purposes)
Or if you want to provide much more info: