Like a symlink for a binary inside WSL 2
Proxy application calls selected binary inside specified WSL 2 distro.
Application loads 2 ini files relative to itself:
wsllinks.ini- default configuration<binary-name-no-ext>.ini- overrides
Supported properties:
mode- optional, operation mode, currently supported "wsl" (default) or "direct";distro- mandatory, "wsl" mode only, name of the WSL distro, can't be empty;user- optinonal, "wsl" mode only, user name to use, if skipped then will use default user configured by WSL 2;shellType- optional, "wsl" mode only, supported types are "standard", "login", "none", if missing then command will be executed with --exec argument;binary- optional, should be equal to<binary-name-no-ext>or absolute path of the form/some/path/<binary-name-no-ext>in "wsl" mode or absolute or relative path in Windows format in direct mode;baseDir- optional, "direct" mode only, should be absolute path, sets base dir forbinarylookup, if missing then current executable dir is used as a base.
To output release information from distro named Ubuntu and user named user:
Build the app:
go buildRename it to macth cat command:
move go-wsllinks.exe cat.exePrepare config:
echo distro = Ubuntu > cat.ini
echo user = user >> cat.iniCall the command:
cat /etc/os-releaseTo output information from default msys2 installation:
Build the app:
go buildRename it to macth uname command:
move go-wsllinks.exe uname.exePrepare config:
echo mode = direct > uname.ini
echo binary = C:\msys64\usr\bin\uname.exe >> uname.iniCall the command:
uname -a