Z
Z
Zyxisix2020-06-14 11:41:48
git
Zyxisix, 2020-06-14 11:41:48

How does git understand on which directory commands like "git clone ..." were called?

Hello, I want to write a program that sorts files in a folder so that it is convenient to use it without a user interface, I decided to write a console version, for more convenience I decided to install it in such a way that .bat files end up in the Windows folder and due to this it can be used on the command line with a call to the name of the .bat file.
And to make it very convenient, I would like to make it run in such a way that you can run the conditional "clean" command without passing the "directory path" argument manually, and it was passed from the context, that is, conditionally: if I called the command while in the directory in CMD "D:\downloads" then the argument "D:\downloads" was passed to bat.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
2
2CHEVSKII, 2020-06-14
@Zyxisix

If the question is

How git understands on which directory the commands were called

then the answer is getcwd()
But I don't know how it will help you. You don't look like someone who knows C.
PS: Throwing something into the Windows folder is fundamentally wrong and potentially dangerous. You must add the program path to PATH.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question