sillsdev / languageforge-lexbox

Lexbox, SIL linguistic data hub
MIT License
7 stars 2 forks source link

Remove -Resume parameter from Invoke-Webrequest commands in `task setup` #880

Closed rmunn closed 4 months ago

rmunn commented 5 months ago

In https://github.com/sillsdev/languageforge-lexbox/pull/850 I used the Powershell command Invoke-WebRequest -Resume, which was introduced in Powershell 6.1. I did not realize that even on Windows 11, the Powershell version that ships with the OS is Powershell 5.1, and to get the latest version of Powershell 6 or higher (currently 7.4) you need to download an .msi file from GitHub. (Also, the command name changed from powershell to pwsh).

We need to either:

rmunn commented 5 months ago

Looks like -Resume is buggy anyway: although PowerShell/PowerShell#13982 is marked as completed, it's still happening. If you pass -Resume when the file already exists, PowerShell throws a NullReferenceError. I suspect that this line is to blame, but I'm not going to spend time troubleshooting PowerShell; that's a total waste of my time. We'll just check that the zip file matches a checksum (which we will check into Git so that we can change it later if we upload a different version of the sena-3.zip file, for example), and skip the download if the checksum matches. If it doesn't match, we'll download without -Resume, which is documented to overwrite any existing files.

hahn-kev commented 5 months ago

let's just remove the -Resume

rmunn commented 4 months ago

The valid SHA256 checksums for sena-3.zip and elawa.zip, which you should hardcode into the Taskfile.yml, are: