Commit 7df41be4 authored by Robert Bailey's avatar Robert Bailey

Merge pull request #24403 from kargakis/use-platform-agnostic-func

kubectl: use platform-agnostic helper in edit
parents 5916baa3 cf7671d2
...@@ -22,7 +22,7 @@ import ( ...@@ -22,7 +22,7 @@ import (
"fmt" "fmt"
"io" "io"
"os" "os"
"path" "path/filepath"
gruntime "runtime" gruntime "runtime"
"strings" "strings"
...@@ -227,7 +227,7 @@ outter: ...@@ -227,7 +227,7 @@ outter:
// launch the editor // launch the editor
editedDiff := edited editedDiff := edited
edited, file, err = edit.LaunchTempFile(fmt.Sprintf("%s-edit-", path.Base(os.Args[0])), ext, buf) edited, file, err = edit.LaunchTempFile(fmt.Sprintf("%s-edit-", filepath.Base(os.Args[0])), ext, buf)
if err != nil { if err != nil {
return preservedFile(err, results.file, errOut) return preservedFile(err, results.file, errOut)
} }
...@@ -350,7 +350,7 @@ outter: ...@@ -350,7 +350,7 @@ outter:
// 3. invalid: retry those on the spot by looping ie. reloading the editor // 3. invalid: retry those on the spot by looping ie. reloading the editor
if results.retryable > 0 { if results.retryable > 0 {
fmt.Fprintln(errOut, errorMsg) fmt.Fprintln(errOut, errorMsg)
fmt.Fprintf(errOut, "You can run `%s replace -f %s` to try this update again.\n", path.Base(os.Args[0]), file) fmt.Fprintf(errOut, "You can run `%s replace -f %s` to try this update again.\n", filepath.Base(os.Args[0]), file)
continue outter continue outter
} }
if results.notfound > 0 { if results.notfound > 0 {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment