MHe*_*bes 2 bash cmd batch-file git-bash
与这个问题相关。
cl.exe
我想在 Windows 上从 git bash运行。通常您需要开发人员提示才能执行此操作,因此我这样做:
cmd //V //K "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\Tools\VsDevCmd.bat"
Run Code Online (Sandbox Code Playgroud)
这会将开发者提示符作为子 shell 打开。如果我愿意的话,我可以从那里逃跑cl
。
但是,如果我可以从 git bash 运行命令而无需进入子 shell,那就太好了。我会很高兴:
以某种方式“ source
ing”文件VsDevCmd.bat
以导出它设置为环境中变量的变量,这样我就可以cl
从 bash 运行,或者
将 更改//K
为 a//C
并更改为当前(bash)工作目录,然后cl
使用转发的任何参数执行。如果它是别名,则奖励积分。
根本无法弄清楚#1。
我需要 #2 语法方面的帮助,因为 while
cmd //V //C "C:\Program Files (x86)\...\VsDevCmd.bat"
Run Code Online (Sandbox Code Playgroud)
工作的意思是它执行批处理脚本并立即退出,我不知道如何将多个命令链接在一起。跑步
cmd //V //C "C:\Program Files (x86)\...\VsDevCmd.bat & cl"
Run Code Online (Sandbox Code Playgroud)
例如,给出
'C:\Program' is not recognized as an internal or external command,
operable program or batch file.
Run Code Online (Sandbox Code Playgroud)
如何cl.exe
直接从 git bash 执行,而不需要单独的提示符?
小智 5
对于使用新 Windows 终端的任何人来说,这里是我的配置文件,用于将 git bash 与 Visual Studio 编译器一起使用:
{
"colorScheme": "One Half Dark",
"commandline": "\"C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Professional\\VC\\Auxiliary\\Build\\vcvars64.bat\" && \"C:\\Program Files\\Git\\bin\\bash.exe\" --login",
"cursorShape": "bar",
"font":
{
"face": "Lucida Sans Typewriter"
},
"guid": "{14ad203f-52cc-4110-90d6-d96e0f41b64d}",
"icon": "%PROGRAMFILES%/Git/mingw64/share/git/git-for-windows.ico",
"name": "Git Bash",
"tabTitle": "Git Bash"
}
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
1425 次 |
最近记录: |