refactor: drop extra args from procfile-extract

They were not necessary.
This commit is contained in:
Jose Diaz-Gonzalez committed 2020-11-21 20:57:33 -05:00
1 parent 06ce3dfadb
commit f9969a0e61
4 files changed
+14 -20

No files matched your search

+1 -1
View File
@@ -1481,7 +1481,7 @@ curl "https://dokku.me/starting/${APP}" || true
- Description: Extracts a Procfile from a given image to a path
- Invoked by: `internally`
- Arguments: `$APP $IMAGE $FORCE_EXTRACT $PROCFILE_PATH`
- Arguments: `$APP $IMAGE`
- Example:
```shell
+1 -3
View File
@@ -110,10 +110,8 @@ func getPhaseScript(appName string, image string, phase string) (string, error)
// getReleaseCommand extracts the release command from a given app's procfile
func getReleaseCommand(appName string, image string) string {
forceExtract := "true"
err := common.SuppressOutput(func() error {
return common.PlugnTrigger("procfile-extract", []string{appName, image, forceExtract}...)
return common.PlugnTrigger("procfile-extract", []string{appName, image}...)
})
if err != nil {
+1 -3
View File
@@ -54,9 +54,7 @@ func main() {
case "procfile-extract":
appName := flag.Arg(0)
image := flag.Arg(1)
forceExtract := common.ToBool(flag.Arg(2))
procfilePath := flag.Arg(3)
err = ps.TriggerProcfileExtract(appName, image, forceExtract, procfilePath)
err = ps.TriggerProcfileExtract(appName, image)
case "procfile-get-command":
appName := flag.Arg(0)
processType := flag.Arg(1)
+11 -13
View File
@@ -139,21 +139,19 @@ func TriggerPreDeploy(appName string, imageTag string) error {
return nil
}
func TriggerProcfileExtract(appName string, image string, forceExtract bool, procfilePath string) error {
if procfilePath == "" {
directory := filepath.Join(common.MustGetEnv("DOKKU_LIB_ROOT"), "data", "ps", appName)
if err := os.MkdirAll(directory, 0755); err != nil {
return err
}
if err := common.SetPermissions(directory, 0755); err != nil {
return err
}
procfilePath = getProcfilePath(appName)
func TriggerProcfileExtract(appName string, image string) error {
directory := filepath.Join(common.MustGetEnv("DOKKU_LIB_ROOT"), "data", "ps", appName)
if err := os.MkdirAll(directory, 0755); err != nil {
return err
}
if forceExtract {
if err := common.SetPermissions(directory, 0755); err != nil {
return err
}
procfilePath := getProcfilePath(appName)
if common.FileExists(procfilePath) {
if err := common.PlugnTrigger("procfile-remove", []string{appName, procfilePath}...); err != nil {
return err
}