Skip to content

Conversation

Lampe2020
Copy link

@Lampe2020 Lampe2020 commented May 5, 2025

Contains

Quick documentation fix to make a shown command platform-independent (by adding .\ before gradlew, to make readers on *NIX aware that the command is found in the local directory and not globally)

How to test

Run the command and see if gradlew starts up.

Outstanding before merging

~

With `./` the command also works on *NIX. 
As far as I know (at least in WINE's CMD and in PowerShell on Window$ it is like that for sure) `./` works on Window$ too, as it automatically converts the `/` to a `\\`.
@Cervator
Copy link
Member

Cervator commented May 6, 2025

This might be a little tricky - traditionally I've leaned toward just showing the Windows variant that just uses the file, then those on Linux et al are likely used to adding those sorts of extras on their own.

Just showing an all-compatible version would be nice, but at least on my system the slash in fact does not auto-convert :-(

D:\Dev\Terasology>./yay.bat
'.' is not recognized as an internal or external command,
operable program or batch file.

D:\Dev\Terasology>.\yay.bat

D:\Dev\Terasology>echo yay
yay

@Lampe2020
Copy link
Author

I just checked, PowerShell supports calling commands with / in the path (tried with /Windows/explorer.exe, which popped open an explorer window) and AFAIK Window$ defaults to PowerShell nowadays.
Anyways, I can change it to \. Because in Window$ you can definitely use .\gradlew in the directory with gradlew. And because there was no path there I assumed it to be an installable command, not a script in the current directory (the .\ would immediately have told me that and saved me a few minutes desperately trying to install gradlew because I was tired and just followed the instructions).

→ Should still work on Window$ and tell anyone on *NIX that the command is in the working directory (implying `./` for those)
@Lampe2020
Copy link
Author

I just tested it by cding to C:\Windows and running .\explorer from there, it opened Explorer, so it automatically adds the filename extension if not provided.
That should also seamlessly translate to the gradlew command, but I am too lazy to download git on Window$, so I did not test exactly that.

@Cervator
Copy link
Member

Cervator commented May 6, 2025

Yeah, Powershell tends to be more common now, but is not everywhere. I personally still prefer plain old cmd maybe from having grown up with it 😅

And since plain gradlew (on Windows at least) beats .\gradlew (which won't work on Linux?) this is probably one of those things we just fix with context - "The following document uses <style> of command, keep that in mind if you run it on a different system!" or so - I think we have that in some places, but definitely not in all :-)

@Lampe2020
Copy link
Author

The .\ doesn't break it on Window$ and would have told me the command is in the same directory. I could of course also change it to the plain command and a note for *NIX users that the command is local, because most that need the docs to run a Terasology server are not too familiar with gradle either to instinctively know that that one command is not global.

@BenjaminAmos
Copy link
Contributor

There is a footnote about this in the contributor quick start guide: https://terasology.org/Terasology/#/Contributor-Quick-Start?id=f4.

Under normal circumstances with an active project I would not recommend running a server from source unless you intend to work on the codebase itself. For most users, it would be run from the same prebuilt jar that they use to play the game normally. That ensures the versions remain compatible, since I do not believe we ensure backwards compatibility on the wire protocol at this time.

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.

3 participants