Skip to content

Latest commit

 

History

History
41 lines (24 loc) · 1.2 KB

File metadata and controls

41 lines (24 loc) · 1.2 KB

powershell

Go package that provides cross-platform shell command execution for cmdIDE. On Windows it routes commands through PowerShell; on macOS and Linux it falls back to sh.

Import

import ps "github.com/Command-IDE/powershell"

API

BuildShellCmd(parts []string) *exec.Cmd

Returns an *exec.Cmd that runs the joined parts as a shell command using the platform-appropriate shell.

  • Windowspowershell.exe -NoProfile -ExecutionPolicy Bypass -Command <cmd>
  • macOS / Linuxsh -c <cmd>

Command(parts []string) *exec.Cmd (Windows only)

Returns a PowerShell-backed *exec.Cmd. Use BuildShellCmd for cross-platform code.

DefaultShell (Windows only)

String constant "powershell.exe" — the executable used for interactive sessions on Windows.

Build tags

File Tag Purpose
shell.go windows PowerShell implementation
shell_other.go !windows POSIX sh fallback

Used by

This package is a sub-module of cmdIDE and is consumed via a replace directive in the host app's go.mod during development.

License

MIT