Namespace src/Linux/Wsl
src/Linux/Wsl
Overview
Directory src/Linux/Wsl
file source src/Linux/Wsl/assertWindowsEtcHost.sh
Linux::Wsl::assertWindowsEtcHost
Check if Host is defined in etc/hosts of windows
Arguments
- $1 host:String
Exit codes
- 1: if hostname not found
src/Linux/Wsl/cachedWslpath.sh
file source src/Linux/Wsl/cachedWslpath.sh
Linux::Wsl::cachedWslpath
retrieve wslpath using cache (cache is refreshed every day)
Arguments
- … (args:String[]): arguments to pass to wslpath
Environment variables
- WSL_TMPDIR (String): temp directory to store the wslpath cache (default value: TMPDIR), you can use PERSISTENT_TMPDIR instead
Exit codes
- if Linux::Wsl::originalWslpath cannot find the path
Output on stderr
- diagnostics information is displayed
Requires
- Linux::Wsl::requireWsl
Features
- cache
src/Linux/Wsl/cachedWslpath2.sh
file source src/Linux/Wsl/cachedWslpath2.sh
Linux::Wsl::cachedWslpath2
retrieve wslpath using cache (cache is refreshed every day)
Arguments
- … (args:String[]): arguments to pass to wslpath
Environment variables
- WSL_TMPDIR (String): temp directory to store the wslpath cache (default value: PERSISTENT_TMPDIR), you can use TMPDIR instead
Exit codes
- if Linux::Wsl::originalWslpath cannot find the path
Output on stderr
- diagnostics information is displayed
Requires
- Linux::Wsl::requireWsl
Features
- cache
src/Linux/Wsl/cachedWslpathFromWslVar.sh
file source src/Linux/Wsl/cachedWslpathFromWslVar.sh
Linux::Wsl::cachedWslpathFromWslVar
retrieve path from wslvar and then use wslpath to resolve it using cache (cache is refreshed every day)
Arguments
- $1 (var:String): the var to retrieve using wslvar
- … (args:String[]): (optional) additional arguments to pass to wslvar
Environment variables
- WSL_TMPDIR (String): temp directory to store the wslpath cache (default value: TMPDIR), you can use PERSISTENT_TMPDIR instead
Exit codes
- if Linux::Wsl::originalWslpath cannot find the path or Linux::Wsl::originalWslvar cannot find the var
Output on stderr
- diagnostics information is displayed
Requires
- Linux::Wsl::requireWsl
Features
- cache
src/Linux/Wsl/cachedWslpathFromWslVar2.sh
file source src/Linux/Wsl/cachedWslpathFromWslVar2.sh
Linux::Wsl::cachedWslpathFromWslVar2
retrieve path from wslvar and then use wslpath to resolve it using cache (cache is refreshed every day)
Arguments
- $1 (var:String): the var to retrieve using wslvar
- … (args:String[]): (optional) additional arguments to pass to wslvar
Environment variables
- WSL_TMPDIR (String): temp directory to store the wslpath cache (default value: PERSISTENT_TMPDIR), you can use TMPDIR instead
Exit codes
- 1: if var cannot be found in cache nor using Linux::Wsl::originalWslvar
- 2: if path cannot be found in cache nor using Linux::Wsl::originalWslpath
Output on stderr
- diagnostics information is displayed
Requires
- Linux::Wsl::requireWsl
Features
- cache
src/Linux/Wsl/cachedWslvar.sh
file source src/Linux/Wsl/cachedWslvar.sh
Linux::Wsl::cachedWslvar
retrieve wslvar using cache (cache is refreshed every day)
Arguments
- … (args:String[]): arguments to pass to wslvar
Environment variables
- WSL_TMPDIR (String): temp directory to store the wslvar cache (default value: TMPDIR), you can use PERSISTENT_TMPDIR instead
Exit codes
- if Linux::Wsl::originalWslvar cannot find the variable
Output on stderr
- diagnostics information is displayed
Requires
- Linux::Wsl::requireWsl
Features
- cache
src/Linux/Wsl/cachedWslvar2.sh
file source src/Linux/Wsl/cachedWslvar2.sh
Linux::Wsl::cachedWslvar2
retrieve wslvar using cache (cache is refreshed every day)
Arguments
- $1 (cachedWslvar2_var:&String): the variable to set by reference if the value is found
- … (args:String[]): arguments to pass to wslvar
Environment variables
- WSL_TMPDIR (String): temp directory to store the wslvar cache (default value: PERSISTENT_TMPDIR), you can use TMPDIR instead
Exit codes
- if Linux::Wsl::originalWslvar cannot find the variable
Output on stderr
- diagnostics information is displayed
Requires
- Linux::Wsl::requireWsl
Features
- cache
src/Linux/Wsl/initEnv.sh
file source src/Linux/Wsl/getKeyFromWslpathOptions.sh
Linux::Wsl::initEnv
initialize some important variables for scripts to run correctly when wsl installation is run under wsl is in progress
Function has no arguments.
Environment variables
- WSL_INIT (int): 0 to disable wsl env initialization
Variables set
- PATH (String): populated with WINDOW_PATH paths
- WSL_INTEROP (String): with current used process
- WSL_DISTRO_NAME (String): initialized using wslpath -m /
Output on stderr
- diagnostics information is displayed
Requires
- Linux::Wsl::requireWsl
Features
- cache
Warnings
- initialization skipped if script not run under wsl
src/Linux/Wsl/originalWslpath.sh
file source src/Linux/Wsl/originalWslpath.sh
Linux::Wsl::originalWslpath
call simply original wslpath command
Arguments
- … (args:String[]): args to pass to wslpath
Exit codes
- wslpath exit code
Output on stdout
- wslpath stdout
Requires
- Linux::Wsl::requireWsl
src/Linux/Wsl/originalWslvar.sh
file source src/Linux/Wsl/originalWslvar.sh
Linux::Wsl::originalWslvar
call simply original wslvar command
Arguments
- … (args:String[]): args to pass to wslvar
Exit codes
- wslvar exit code
Output on stdout
- wslvar stdout
Requires
- Linux::Wsl::requireWsl
src/Linux/Wsl/requireWsl.sh
file source src/Linux/Wsl/requireWsl.sh
Linux::Wsl::requireWsl
ensure linux runs under wsl
Environment variables
- WSL_GARBAGE_COLLECT (int): 0 to disable garbage collect of cache files
Exit codes
- 1: if linux does not run under wsl