From 943e032d127bebade3840a8fdee178df19a6f54c Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sat, 10 Oct 2020 17:24:31 -0400 Subject: [PATCH] refactor: use path/filepath instead of path for joining path parts --- plugins/buildpacks/triggers.go | 4 ++-- plugins/common/properties.go | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/plugins/buildpacks/triggers.go b/plugins/buildpacks/triggers.go index 26481c634..3f0c0f528 100644 --- a/plugins/buildpacks/triggers.go +++ b/plugins/buildpacks/triggers.go @@ -4,7 +4,7 @@ import ( "bufio" "fmt" "os" - "path" + "path/filepath" "github.com/dokku/dokku/plugins/common" ) @@ -58,7 +58,7 @@ func TriggerPostExtract(appName string, sourceWorkDir string) { return } - buildpacksPath := path.Join(sourceWorkDir, ".buildpacks") + buildpacksPath := filepath.Join(sourceWorkDir, ".buildpacks") file, err := os.OpenFile(buildpacksPath, os.O_RDWR|os.O_TRUNC|os.O_CREATE, 0600) if err != nil { common.LogFail(fmt.Sprintf("Error writing .buildpacks file: %s", err.Error())) diff --git a/plugins/common/properties.go b/plugins/common/properties.go index 437ac12ce..f164a9c55 100644 --- a/plugins/common/properties.go +++ b/plugins/common/properties.go @@ -7,7 +7,7 @@ import ( "io/ioutil" "os" "os/user" - "path" + "path/filepath" "reflect" "strconv" "strings" @@ -447,17 +447,17 @@ func PropertySetup(pluginName string) error { func getPropertyPath(pluginName string, appName string, property string) string { pluginAppConfigRoot := getPluginAppPropertyPath(pluginName, appName) - return path.Join(pluginAppConfigRoot, property) + return filepath.Join(pluginAppConfigRoot, property) } // getPluginAppPropertyPath returns the plugin property path for a given plugin/app combination func getPluginAppPropertyPath(pluginName string, appName string) string { - return path.Join(getPluginConfigPath(pluginName), appName) + return filepath.Join(getPluginConfigPath(pluginName), appName) } // getPluginConfigPath returns the plugin property path for a given plugin func getPluginConfigPath(pluginName string) string { - return path.Join(MustGetEnv("DOKKU_LIB_ROOT"), "config", pluginName) + return filepath.Join(MustGetEnv("DOKKU_LIB_ROOT"), "config", pluginName) } // makePluginAppPropertyPath ensures that a property path exists