[英]Run shell script globally in Git bash in Windows
[英]How to run ./script.sh in windows Git shell?
也許這很尷尬,但是當我在Git shell中工作時,我無法在Windows上運行.sh文件。 可能我必須安裝一些東西,但我認為Git將支持該bash命令(我知道Windows不使用sh文件)。
我正在從GameClosure進行安裝步驟,在$ ./install.sh
一個打開sh文件的應用程序選擇的窗口(就像當你嘗試在Windows中打開未知文件時那樣,它會詢問你想要使用哪個應用程序打開它)。 我試過用Git shell打開它,但是失敗了...... 我要做什么來運行這個文件並從GameClosure教程繼續安裝步驟?**
這是一個截圖(波蘭語提醒,但我想你們都知道這個消息)。
嘗試使用msysgit提供的git-bash
和Git Bash.vbs
快捷方式。
Msysgit也打包在GitHub for Windows中 ,即使暴露的shell是基於posh-git 的Powershell 。 那(powershell)將解釋為什么*.sh
腳本無法在其上運行。
OP Szorstki 在評論中提到GitHub for Windows應用程序中實際存在一個設置,可以將Git Bash設置為默認命令行工具。
嘗試安裝bash for Windows並在從cmd.exe執行bash后再次運行腳本ag。
調用正確的shell,沒有不必要的窗口,然后調用bash腳本將保留。
例如,在桌面上創建 mintty.exe
的快捷方式
編輯快捷方式的屬性並更改目標(保留路徑):
C:\\Program Files\\Git\\usr\\bin\\mintty.exe" -h always /bin/bash -l -e 'D:\\folder\\script.sh'
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.