-1

I need to run git commands from perl script. For this i need to use complete path of the git. the syntax looks like this

system "start", "cmd.exe", "/k", "cd $Repo_path && $arg1 && exit"; 

Where $arg1 = git/exe/path git command.

Some time the execution of command may get failed due to some reasons. I need to capture the status of the result of the command executed. Atleast if I am able to capture Success or failure, that would also be great. Any help to this is appreciated. Thanks in advance.

2

1 Answer 1

0

In addition to the generic ways of executing external commands, Git::Wrapper may be useful for this specific case. It abstracts running git commands into a standard Perl object interface. You can pass a specific git binary and git directory for it to use as the git_binary and dir constructor parameters, as mentioned in the synopsis, and it throws exceptions if there is an error, which you can catch and handle with various methods.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.