Documentation ¶
Index ¶
- Variables
- func GenerateUsageHint(userShell, cmdLine string) string
- func GenerateUsageHintWithComment(userShell, cmdLine string) string
- func GetEnvString(userShell string, envName string, envValue string) string
- func GetPathEnvString(userShell string, prependedPath string) string
- func GetShell(userShell string) (string, error)
- func IsWindowsSubsystemLinux() bool
- type Config
Constants ¶
This section is empty.
Variables ¶
View Source
var ( CommandRunner = crcos.NewLocalCommandRunner() WindowsSubsystemLinuxKernelMetadataFile = "/proc/version" )
View Source
var (
ErrUnknownShell = errors.New("Error: Unknown shell")
)
Functions ¶
func GenerateUsageHint ¶
func GetPathEnvString ¶
func IsWindowsSubsystemLinux ¶ added in v2.46.0
func IsWindowsSubsystemLinux() bool
IsWindowsSubsystemLinux detects whether current system is using Windows Subsystem for Linux or not
It checks for these conditions to make sure that current system has WSL installed: - `/proc/version` file is present - `/proc/version` file contents contain keywords `Microsoft` and `WSL`
It above conditions are met, then this method returns `true` otherwise `false`.
Types ¶
Click to show internal directories.
Click to hide internal directories.