Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modified Batch file for Windows, if it's called directly #1370

Closed
wants to merge 3 commits into from
Closed

Modified Batch file for Windows, if it's called directly #1370

wants to merge 3 commits into from

Conversation

Zwixx
Copy link

@Zwixx Zwixx commented May 26, 2021

I was tricked by the first install and clicked on my Windows 10 on the gitblit.cmd and nothing happens. I looked into it and a environment Variable "CD" is used, but never set. I modified the batch file, so the current directory of the batch file is used as root folder for the classpath. So it worked without anything else to modify.

So nothing like set up a environment variable is needed.

@flaix
Copy link
Member

flaix commented Jul 16, 2021

The CD variable is a dynamic variable and does not need to be set explicitly. It is automatically set by cmd.exe.
Did you encounter problems because you do call the batch file from a different directory than the Gitblit directory, or because you somehow have CMD Extensions disabled?

In any case I would prefer to use a dedicated variable, like gbhome or something like that, instead of overwriting the automatic variable.

@Zwixx
Copy link
Author

Zwixx commented Jul 17, 2021

I automated it with the build-in variables from Windows NT cmd. It is the current directory, but not the directory of the batch file.
So it don't works if you start it for example in the Windows explorer.

@flaix
Copy link
Member

flaix commented Jul 18, 2021

Yes, it wouldn't have worked for that use case. Thank you for fixing it. If you don't mind, I'll change it to use a different variable name.

@flaix flaix added this to the 1.9.2 milestone Jul 18, 2021
@flaix
Copy link
Member

flaix commented Jul 20, 2021

Actually, I cannot reproduce this problem. Testing this under Windows 10 when I double-click on gitblit.cmd in the Windows Explorer, the server starts without problems. It even works when I create a link and place it in a different directory, then double-click the link.

What does not work, is running the gitblit.cmd command on the command line from a different folder, e.g. gitblit 1.9.1\gitblit.cmd. But this would even need one more change, setting the base folder correctly.

I don't know if the latter is a often used use case, but we can still make it work. Still, I'd rather do it without setting explicit variables.

@flaix flaix closed this in 9a747d0 Jul 21, 2021
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants