app: better warning if src-cli is not installed (#48880)

Sourcegraph already runs best-effort if `src` is not on your path.
However, the errors are not very clear about the impact or how to
install it. This simply adds a better error message for it:


![](https://user-images.githubusercontent.com/3173176/223589485-ea9da879-0a72-46ef-a9c0-deec5e3ad46f.png)

Fixes #46543

## Test plan

Manually tested by removing `src` from my path and running `sg start
app`

---------

Signed-off-by: Stephen Gutekanst <stephen@sourcegraph.com>
Co-authored-by: Joe Chen <joe@sourcegraph.com>
This commit is contained in:
Stephen Gutekanst 2023-03-07 20:42:37 -07:00 committed by GitHub
parent 8ac0afd053
commit 47218d030c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -149,6 +149,14 @@ func Init(logger log.Logger) {
)
}
if _, err := exec.LookPath("src"); err != nil {
printStatusCheckError(
"src-cli is unavailable",
"Sourcegraph is better when src-cli is available; batch changes may not work.",
"Installation: https://github.com/sourcegraph/src-cli",
)
}
// generate a shell script to run a ctags Docker image
// unless the environment is already set up to find ctags
ctagsPath := os.Getenv("CTAGS_COMMAND")