1
0
mirror of https://github.com/garraflavatra/rolens.git synced 2025-07-22 15:18:02 +00:00

Shell feature (#44)

Resolves #37: adds a shell tab where the user can write mongo shell
scripts and execute them.
This commit is contained in:
2023-07-01 21:34:32 +02:00
committed by GitHub
parent 62f4b88ea6
commit 61142844fa
12 changed files with 375 additions and 59 deletions

View File

@ -25,6 +25,7 @@ type EnvironmentInfo struct {
HasMongoExport bool `json:"hasMongoExport"`
HasMongoDump bool `json:"hasMongoDump"`
HasMongoShell bool `json:"hasMongoShell"`
HomeDirectory string `json:"homeDirectory"`
DataDirectory string `json:"dataDirectory"`
@ -49,6 +50,9 @@ func NewApp(version string) *App {
_, err = exec.LookPath("mongoexport")
a.Env.HasMongoExport = err == nil
_, err = exec.LookPath("mongosh")
a.Env.HasMongoShell = err == nil
a.Env.HomeDirectory, err = os.UserHomeDir()
if err != nil {
panic(errors.New("encountered an error while getting home directory"))