Page 1 of 1

Gitbash (commandlet)

Posted: 25 Feb 2016 16:52
by keyhitwuzzy
I want to create a commandlet (the little thing in catalog that let's you click on it and it opens something with an application - just like the "Notepad (try dropping files here)" example).

The purpose should be to open a windows "Gitbash" shell for the currently open folder.

Here is what I got so far, and it's _not_ working:

Code: Select all

"C:\Windows\System32\cmd.exe" /c "pushd <curfolder>"  && "C:\Program Files\Git\bin\sh.exe" --login -i
Any tips on what I am doing wrong?

P.S.: I know that I can right-click and choose "Git Bash Here" - but that only works on _subfolder_ in the current folder. I.e. I can't right-click on a folder in "Catalog" and choose that. What commandlet will let me do is execute this action on the "current" folder.

Re: Gitbash (commandlet)

Posted: 25 Feb 2016 17:07
by bdeshi
You can use this command

Code: Select all

run """%GIT_HOME%\bin\sh.exe"" --login -i", "<curpath>";
The first parameter is the command to run, with inner double-quotes duplicated because the whole strings enclosed in double-quotes, and the second parameter defines the directory.
Image

btw, Welcome to the club! :D :cup:

Re: Gitbash (commandlet)

Posted: 27 Feb 2016 05:26
by keyhitwuzzy
Thanks, the command worked perfectly!

Code: Select all

run """C:\Program Files\Git\bin\sh.exe"" --login -i", "<curpath>";
P.S.: Purchased xyplorer since it's such a great tool. Running windows 10 :-)