feat: add created-at time to apps:report output
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
package apps
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/dokku/dokku/plugins/common"
|
||||
)
|
||||
|
||||
@@ -11,6 +14,7 @@ func ReportSingleApp(appName string, format string, infoFlag string) error {
|
||||
}
|
||||
|
||||
flags := map[string]common.ReportFunc{
|
||||
"--app-created-at": reportCreatedAt,
|
||||
"--app-deploy-source": reportDeploySource,
|
||||
"--app-deploy-source-metadata": reportDeploySourceMetadata,
|
||||
"--app-dir": reportDir,
|
||||
@@ -28,6 +32,15 @@ func ReportSingleApp(appName string, format string, infoFlag string) error {
|
||||
return common.ReportSingleApp("app", appName, infoFlag, infoFlags, flagKeys, format, trimPrefix, uppercaseFirstCharacter)
|
||||
}
|
||||
|
||||
func reportCreatedAt(appName string) string {
|
||||
fi, err := os.Stat(common.AppRoot(appName))
|
||||
if err != nil {
|
||||
return ""
|
||||
}
|
||||
|
||||
return fmt.Sprint(fi.ModTime().Unix())
|
||||
}
|
||||
|
||||
func reportDeploySource(appName string) string {
|
||||
return common.PropertyGet("apps", appName, "deploy-source")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user