refactor: move apps listing from common plugin to apps plugin
This helps centralize app-related listing fetching.
This commit is contained in:
@@ -11,6 +11,7 @@ import (
|
||||
"text/template"
|
||||
|
||||
appjson "github.com/dokku/dokku/plugins/app-json"
|
||||
apps "github.com/dokku/dokku/plugins/apps"
|
||||
"github.com/dokku/dokku/plugins/common"
|
||||
|
||||
cronparser "github.com/robfig/cron/v3"
|
||||
@@ -99,7 +100,7 @@ func deleteCrontab() error {
|
||||
}
|
||||
|
||||
func writeCronEntries() error {
|
||||
apps, _ := common.DokkuApps()
|
||||
apps, _ := apps.DokkuApps()
|
||||
commands := []templateCommand{}
|
||||
for _, appName := range apps {
|
||||
scheduler := common.GetAppScheduler(appName)
|
||||
|
||||
@@ -4,12 +4,15 @@ go 1.16
|
||||
|
||||
require (
|
||||
github.com/dokku/dokku/plugins/app-json v0.0.0-00010101000000-000000000000
|
||||
github.com/dokku/dokku/plugins/apps v0.0.0-00010101000000-000000000000
|
||||
github.com/dokku/dokku/plugins/common v0.0.0-00010101000000-000000000000
|
||||
github.com/robfig/cron/v3 v3.0.1
|
||||
github.com/ryanuber/columnize v1.1.2-0.20190319233515-9e6335e58db3
|
||||
github.com/spf13/pflag v1.0.5
|
||||
)
|
||||
|
||||
replace github.com/dokku/dokku/plugins/apps => ../apps
|
||||
|
||||
replace github.com/dokku/dokku/plugins/app-json => ../app-json
|
||||
|
||||
replace github.com/dokku/dokku/plugins/common => ../common
|
||||
|
||||
@@ -3,6 +3,7 @@ package cron
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/dokku/dokku/plugins/apps"
|
||||
"github.com/dokku/dokku/plugins/common"
|
||||
"github.com/ryanuber/columnize"
|
||||
)
|
||||
@@ -31,7 +32,7 @@ func CommandList(appName string) error {
|
||||
// CommandReport displays a cron report for one or more apps
|
||||
func CommandReport(appName string, format string, infoFlag string) error {
|
||||
if len(appName) == 0 {
|
||||
apps, err := common.DokkuApps()
|
||||
apps, err := apps.DokkuApps()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user