Merge pull request #6524 from dokku/6490-dos2unix-copy

Ensure all copied files always have line endings converted to unix-style
This commit is contained in:
Jose Diaz-Gonzalez
2024-01-25 00:37:01 -05:00
committed by GitHub
10 changed files with 56 additions and 70 deletions

View File

@@ -8,7 +8,6 @@ require (
github.com/dokku/dokku/plugins/config v0.0.0-00010101000000-000000000000
github.com/dokku/dokku/plugins/docker-options v0.0.0-00010101000000-000000000000
github.com/gofrs/flock v0.8.1
github.com/otiai10/copy v1.14.0
github.com/ryanuber/columnize v2.1.2+incompatible
github.com/spf13/pflag v1.0.5
)
@@ -24,6 +23,7 @@ require (
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/melbahja/goph v1.4.0 // indirect
github.com/otiai10/copy v1.14.0 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pkg/sftp v1.13.5 // indirect
golang.org/x/crypto v0.18.0 // indirect

View File

@@ -14,7 +14,6 @@ import (
"github.com/dokku/dokku/plugins/common"
"github.com/dokku/dokku/plugins/config"
dockeroptions "github.com/dokku/dokku/plugins/docker-options"
"github.com/otiai10/copy"
)
// TriggerAppRestart restarts an app
@@ -90,12 +89,12 @@ func TriggerCorePostExtract(appName string, sourceWorkDir string) error {
return common.TouchFile(fmt.Sprintf("%s.missing", processSpecificProcfile))
}
if err := copy.Copy(repoProcfilePath, processSpecificProcfile); err != nil {
if err := common.Copy(repoProcfilePath, processSpecificProcfile); err != nil {
return fmt.Errorf("Unable to extract Procfile: %v", err.Error())
}
if procfilePath != "Procfile" {
if err := copy.Copy(repoProcfilePath, repoDefaultProcfilePath); err != nil {
if err := common.Copy(repoProcfilePath, repoDefaultProcfilePath); err != nil {
return fmt.Errorf("Unable to move Procfile into place: %v", err.Error())
}
}