mirror of
https://github.com/fleetdm/fleet
synced 2026-05-23 17:08:53 +00:00
Fix root dir detection when using orbit shell (#5844)
* fix old root dir in orbit * add changes
This commit is contained in:
parent
1365bb6cf8
commit
4398644185
2 changed files with 10 additions and 6 deletions
1
changes/issue-5734-fix-orbit-shell-root
Normal file
1
changes/issue-5734-fix-orbit-shell-root
Normal file
|
|
@ -0,0 +1 @@
|
|||
* Fixed an issue with detecting root directory when using `orbit shell`.
|
||||
|
|
@ -135,12 +135,7 @@ func main() {
|
|||
EnvVars: []string{"ORBIT_FLEET_DESKTOP"},
|
||||
},
|
||||
}
|
||||
app.Action = func(c *cli.Context) error {
|
||||
if c.Bool("version") {
|
||||
fmt.Println("orbit " + build.Version)
|
||||
return nil
|
||||
}
|
||||
|
||||
app.Before = func(c *cli.Context) error {
|
||||
// handle old installations, which had default root dir set to /var/lib/orbit
|
||||
if c.String("root-dir") == "" {
|
||||
rootDir := update.DefaultOptions.RootDirectory
|
||||
|
|
@ -155,6 +150,14 @@ func main() {
|
|||
c.Set("root-dir", rootDir)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
app.Action = func(c *cli.Context) error {
|
||||
if c.Bool("version") {
|
||||
fmt.Println("orbit " + build.Version)
|
||||
return nil
|
||||
}
|
||||
|
||||
var logFile io.Writer
|
||||
if logf := c.String("log-file"); logf != "" {
|
||||
if logDir := filepath.Dir(logf); logDir != "." {
|
||||
|
|
|
|||
Loading…
Reference in a new issue