EnigmaticaModpacks / ModpackUploader

Automation tool for uploading Modpacks to CurseForge.
Apache License 2.0
15 stars 9 forks source link

[Linux] curl.exe doesn't exist #22

Closed FederAndInk closed 1 year ago

FederAndInk commented 1 year ago

Modpack Version

none

Describe your issue.

curl.exe won't work on Linux, I think you'll need a variable set to curl.exe on win and to curl on Linux

btw, I think you need to change your issue template for this repo ^^

Crash Report

No response

Latest Log

No response

Have you modified the modpack?

No

User Modifications

No response

Did the issue happen in singleplayer or on a server?

Both

Discord Username

No response

NielsPilgaard commented 1 year ago

Thanks for the report, I'll get that fixed (eventually ๐Ÿ˜…)

FederAndInk commented 1 year ago

thanks, I would have done it, but I don't know powershell, I've seen there is $IsWindows $IsLinux variables though. Python could have been more widespread and Linux friendly :p

FederAndInk commented 1 year ago

Python could have been more widespread and Linux friendly :p

But great project anyways :smile:

NielsPilgaard commented 1 year ago

I removed those variables ๐Ÿ˜“

FederAndInk commented 1 year ago

what do you mean? shouldn't they be built-in?

FederAndInk commented 1 year ago

this is what I get out of the box:

PS /home/nihil> Write-Host $IsLinux
True
PS /home/nihil> Write-Host $IsWindows
False
PS /home/nihil> Write-Host $IsMacos
False
NielsPilgaard commented 1 year ago

I'm afraid those variables only exist in Powershell Core, not the windows native version, so I can't rely on them :/

FederAndInk commented 1 year ago

well then, you could try to see if the variable is defined and do:

if IsWindows not defined or $IsWindows
  use curl.exe
else
  use curl
FederAndInk commented 1 year ago

found this otherwise: https://devblogs.microsoft.com/scripting/powertip-determine-your-version-of-powershell-and-host-operating-system/

using $PSVersionTable

Scripting Blog
PowerTip: Determine your version of PowerShell and host operating system
Identify your PowerShell environment by making use of built-in PowerShell variables.
NielsPilgaard commented 1 year ago

Should be all fixed, thanks for the helpful pointers :) Edit: Would you mind checking if the fix actually works? I only have a Windows laptop at my disposal

FederAndInk commented 1 year ago

no problem, thank you for the fix. btw, isn't possible to store curl or curl.exe in a variable like in bash? and use it as a command

NielsPilgaard commented 1 year ago

Oh, it actually is. That simplifies this greatly.

NielsPilgaard commented 1 year ago

Changed, thanks :D https://github.com/EnigmaticaModpacks/ModpackUploader/releases/tag/2.3.2

GitHub
Release 2.3.2 ยท EnigmaticaModpacks/ModpackUploader
What's Changed simplify how the curl command is determined by @NielsPilgaard in #26 Full Changelog: 2.3.0...2.3.2