Git Shell 中的流星 (mingw) [英] Meteor in Git Shell (mingw)

查看:15
本文介绍了Git Shell 中的流星 (mingw)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试为 Meteor JS 编写教程,但我无法使用 Windows 版 Github 附带的 Git Shell 使其正常工作.它找不到流星命令.它在 cmd 中工作,并且在 Windows 环境路径中.我究竟做错了什么?

I am trying to do the tutorial for Meteor JS but I can't get it to work properly using the Git Shell that comes with Github for Windows. It can't find the meteor command. It works in cmd and it is in the Windows environment path. What am I doing wrong?

推荐答案

要从 MinGW 的 MSYS shell 运行 *.bat 命令,您必须将执行重定向到 <代码>cmd.exe,因此:

To run a *.bat command from MinGW's MSYS shell, you must redirect the execution to cmd.exe, thus:

cmd //c foo.bat [args ...]

foo.bat 命令文件必须位于$PATH 内的目录中,(或者您必须指定完整路径名... 使用斜杠,不是 反斜杠,除非您为每个路径名分隔符使用两个反斜杠).另外,请注意双斜杠通知 cmd.exe 您正在使用它的 /C 选项,(因为它不接受 -c> MSYS shell 首选的形式.

The foo.bat command file must be in a directory within $PATH, (or you must specify the full path name ... using slashes, not backslashes unless you use two of them for each path name separator). Also, note the double slash to inform cmd.exe that you are using its /C option, (since it doesn't accept the -c form preferred by the MSYS shell.

如果您想让 foo.bat 文件直接从 MSYS shell 执行,您可以创建一个两行的 Bourne shell 包装脚本,简单地称为 foo 旁边,(在与 foo.bat 相同的目录中),因此:

If you'd like to make the foo.bat file directly executable from the MSYS shell, you may create a two line Bourne shell wrapper script called simply foo alongside it, (in the same directory as foo.bat), thus:

#!/bin/sh
cmd //c "$0.bat" "$@"

(因此,在您的情况下,您需要在 meteor.bat 旁边创建脚本文件 meteor).

(so in your case, you'd create script file meteor alongside meteor.bat).

事实上,由于这个包装脚本是完全通用的,只要您的文件系统支持硬文件链接,(就像 NTFS 对单个磁盘分区上的文件所做的那样),您可以创建一个包装脚本,并将其链接到尽可能多的命令文件名,就像您希望以这种方式调用的 *.bat 文件一样;(提示:使用 MSYS ln 命令链接文件).

In fact, since this wrapper script is entirely generic, provided your file system supports hard file links, (as NTFS does for files on one single disk partition), you may create one wrapper script, and link it to as many command file names as you have *.bat files you'd like to invoke in this manner; (hint: use the MSYS ln command to link the files).

这篇关于Git Shell 中的流星 (mingw)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆