WSLProxyFiles
WSL(WidowsSubsystemforLiux)isaawesomebitofiovatiobyMicrosoftthatallowsyoutoruLiuxisideofWidows10withouttheeedforaVirtualMachie.Thishasseveralbeefits,thelargestofwhichisthememorythatyousavebyotruigawholesecodaryOS.Ufortuatelyitalsohasit'sdrawbacks,thebiggestofwhichisadistictlackofsupportthrougheditorssuchasAtom,VSCode,adSublimeText.
Thegoalofthisprojectistocreateacollectioof"proxy"batchfilesthatcabeusedtorouterequeststotheliuxversioofacommad.Almostallofthefileswillhavethesamelayout
@echooffbash.exe-c"php%*"Asaexampleusecasetaketheatom-literpackage.Mostoftheliters,suchasliter-phprequirethepathtoaexecutableiordertoru.IfthatexecutableisisideofWSLhowever,thereisowaytoaccessit.
Usigthewsl-proxyphp.batfilehowever,youcajustreplacethepathtotheexecutablewithC:\\Users\\myuser\\path\\to\\wsl-proxy\\php.bat.RequestsareowbeigroutedtotheliuxversioofPHP.
Protip:IfyoucloethisadaddthecloeddirectorytoyourwidowsPATHyouwillbeabletoaccessayoftheproxiedcommadsthroughcommadprompt(evewithoutthe.batextesio)
Note:ThisisaexperimetcurretlyadIca'tguareteeitwillworkwitheverythig,butpleasefeelfreetoaddfileshere.Let'sturthisitoaoe-stopshopforwsl-proxyfiles.
Auto-geeratigproxyfilesRutheproxyge.cmdscripttoautomaticallygeerateproxies.Asubfolderamed.\autogewillbecreated,adalltheautogeedproxyfileswillbeplacedhere--addthisfoldertoyourWidowsPATHifyouwataccesstotheproxiedcommadswithouttypigiafullpath.
Usage:
(Noargs):proxygePromptsyoutoeterprogramamesfromstdi(pressCTRL-Dwhedoe).(Redirectfromfile):proxyge<program_ame_fileSameasabove,butreadsprogramamesfromafile.(Specifyargsocommadlie):proxygeprogram1program2...Examples:proxygegccg++proxyge/usr/bi/fooproxyge/usr/bi/*proxyge/usr/bi/*/bi/*
Programameswillberesolvedtoabsolutepaths.Ifaprogramisotfoud,awarigmessagewillbedisplayed(theproxywillstillbecreated).










评论