我希望从根目录运行lab,而不必与%bindir%或.\node_modules\.bin\lab.cmd打交道。我希望能够使用$ lab运行测试,仅此而已。
这是我的尝试。记住,我已经在Powershell中为像grep这样的东西设置了一些别名。
$ ll .\node_modules\.bin | grep lab
-a---- 7/5/2017 2:57 PM 293 lab
-a---- 7/5/2017 2:57 PM 170 lab.cmd
$ cmd /c mklink lab .\node_modules\.bin\lab\lab.cmd
symbolic link created for lab <<===>> .\node_modules\.bin\lab\lab.cmd
$ ll lab
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a---l 7/7/2017 9:04 AM 0 lab
$ lab
lab : The term 'lab' is not recognized as the name of a cmdlet, function, script file...
$ ./lab
Program 'lab' failed to run: No application is associated with the specified file...将别名命名为lab.cmd并没有做任何事情。这在Windows上是可能的吗?
发布于 2017-07-08 01:58:54
我真的认为这是一个Windows不是真的那样构建的问题。我确实认为可能有一种方法可以整理出symlink,但实际上,这就是各种powershell配置文件的用途。当某些东西不应该是系统范围的,但你想要简单快速地访问它时。
如果你想让它只对你自己可用,你可以把它放在$profile中,如果你想让任何用户都能使用它,你可以像你把它放在#en0#中一样运行powershell
符号链接的功能在Windows中是存在的,但它不像*nix中那样丰富,无论是好是坏,这取决于位置、文件名和其他一大堆你可能会遇到的各种问题。
https://stackoverflow.com/questions/44975525
复制相似问题