Skip to content

Commit

Permalink
add stubs
Browse files Browse the repository at this point in the history
  • Loading branch information
blacktop committed Dec 27, 2017
1 parent eee3561 commit 92cd34b
Showing 1 changed file with 20 additions and 10 deletions.
30 changes: 20 additions & 10 deletions launch.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,13 @@ func CmdDefaultOrg(verbose bool) error {
log.WithError(err).Fatal("CreateAppFolders")
}

// grp, err := createNewGroup(db, "Porg")
// checkError(err)
// checkError(addAppToGroup(db, "Atom", grp.Title))
// checkError(addAppToGroup(db, "Brave", grp.Title))
// checkError(addAppToGroup(db, "iTerm", grp.Title))
lpad.EnableTriggers()
return restartDock()
}

// CmdSaveConfig will save your launchpad settings to a config file
func CmdSaveConfig(verbose bool) error {
log.Info("IMPLIMENT SAVING TO CONFIG YAML HERE <=================")

// if err := db.Where("type = ?", "4").Find(&items).Error; err != nil {
// log.WithError(err).Error("find item of type=4 failed")
Expand Down Expand Up @@ -158,8 +160,14 @@ func CmdDefaultOrg(verbose bool) error {
// }

log.Infof(bold, strings.ToUpper("successfully wrote launchpad.yaml"))
lpad.EnableTriggers()
return restartDock()

return nil
}

// CmdLoadConfig will load your launchpad settings from a config file
func CmdLoadConfig(verbose bool, configFile string) error {
log.Info("IMPLIMENT LOADING FROM CONFIG YAML HERE <=================")
return nil
}

func init() {
Expand Down Expand Up @@ -212,8 +220,7 @@ func main() {
Name: "save",
Usage: "Save Current Launchpad App Config",
Action: func(c *cli.Context) error {
log.Info("IMPLIMENT SAVING TO CONFIG YAML HERE <=================")
return nil
return CmdSaveConfig(c.GlobalBool("verbose"))
},
},
{
Expand All @@ -222,7 +229,10 @@ func main() {
Action: func(c *cli.Context) error {
if c.Args().Present() {
// user supplied launchpad config YAML
log.Info("IMPLIMENT LOADING FROM CONFIG YAML HERE <=================")
err := CmdLoadConfig(c.Bool("verbose"), c.Args().First())
if err != nil {
return err
}
fmt.Println(porg)
} else {
cli.ShowAppHelp(c)
Expand Down

0 comments on commit 92cd34b

Please sign in to comment.