grain-lang/grain-lang.org

Improve instructions for Getting Grain on Windows

MarkTiedemann opened this issue · 0 comments

You can download it directly from GitHub.

For Linux and MacOS, there's an added "(...) or using curl."

Since 2018, curl is available on Windows by default (see: https://devblogs.microsoft.com/commandline/tar-and-curl-come-to-windows/). So the docs could be updated.

Alternatively, ...

..., if you want to support older systems, there's the Invoke-WebRequest PowerShell cmdlet that can be used to download a file (e.g. Invoke-WebRequest -Uri <URL> -OutFile <FILE> -UseBasicParsing or iwr <URL> -o <FILE> -useb for short).


You’ll either want to put it into your path or keep it inside your project and invoke with ./grain-win-x64.exe.

./ only works in PowerShell. In cmd, you'd want .\:

C:\> ./grain-win-x64.exe -v
'.' is not recognized as an internal or external command,
operable program or batch file.

C:\> .\grain-win-x64.exe -v
Grain cli 0.3.1
Grain compiler 0.3.1

.\ works in PowerShell, too, so I'd suggest using .\grain-win-x64.exe instead.

As a side note, ...

..., if you want to save 4 characters, you can omit .exe: Since .exe is defined as a path extension in the PATHEXT environment variable, .\grain-win-x64 is equivalent to .\grain-win-x64.exe in both cmd and PowerShell.

Also, if the file is in the same directory, .\ is not necessary in cmd, so grain-win-x64 -v is equivalent to .\grain-win-x64 -v. (This does not apply to PowerShell, however.)