Gitbash (commandlet)

Discuss and share scripts and script files...
Post Reply
keyhitwuzzy
Posts: 6
Joined: 25 Feb 2016 16:39

Gitbash (commandlet)

Post 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.

bdeshi
Posts: 4256
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612
Contact:

Re: Gitbash (commandlet)

Post 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:
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

keyhitwuzzy
Posts: 6
Joined: 25 Feb 2016 16:39

Re: Gitbash (commandlet)

Post 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 :-)

Post Reply