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:
@ -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"))
|
||||
|
Reference in New Issue
Block a user