command_windows.go 475 B

123456789101112131415161718192021
  1. package reexec // import "github.com/docker/docker/pkg/reexec"
  2. import (
  3. "os/exec"
  4. )
  5. // Self returns the path to the current process's binary.
  6. // Uses os.Args[0].
  7. func Self() string {
  8. return naiveSelf()
  9. }
  10. // Command returns *exec.Cmd which has Path as current binary.
  11. // For example if current binary is "docker.exe" at "C:\", then cmd.Path will
  12. // be set to "C:\docker.exe".
  13. func Command(args ...string) *exec.Cmd {
  14. return &exec.Cmd{
  15. Path: Self(),
  16. Args: args,
  17. }
  18. }