Skip to content

Commit

Permalink
lil bit of clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
blacktop committed Dec 27, 2017
1 parent 92cd34b commit 58e96d4
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions launch.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,10 @@ func CmdDefaultOrg(verbose bool) error {
lpad.DB = db

if verbose {
// db.LogMode(true)
db.LogMode(true)
}

// Disable the update triggers
if err := lpad.DisableTriggers(); err != nil {
log.WithError(err).Fatal("DisableTriggers failed")
}
Expand All @@ -87,8 +88,10 @@ func CmdDefaultOrg(verbose bool) error {
log.WithError(err).Fatal("AddRootsAndHoldingPagesfailed")
}

// We will begin our group records using the max ids found (groups always appear after apps and widgets)
groupID := math.Max(float64(lpad.GetMaxAppID()), float64(lpad.GetMaxWidgetID()))

// Read in Config file
config, err := database.LoadConfig("launchpad.yaml")
if err != nil {
log.WithError(err).Fatal("database.LoadConfig")
Expand All @@ -98,8 +101,11 @@ func CmdDefaultOrg(verbose bool) error {
if err := lpad.CreateAppFolders(config, int(groupID)); err != nil {
log.WithError(err).Fatal("CreateAppFolders")
}
// Re-enable the update triggers
if err := lpad.EnableTriggers(); err != nil {
log.WithError(err).Fatal("EnableTriggers failed")
}

lpad.EnableTriggers()
return restartDock()
}

Expand Down

0 comments on commit 58e96d4

Please sign in to comment.