-
Notifications
You must be signed in to change notification settings - Fork 14
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
Improve arch and system autodetection #52 #57
Conversation
var RegexDarwin = `(?i)(darwin|mac(os)?|apple|osx)` | ||
var RegexDarwin = `(?i)(darwin|mac(os)?|apple|osx|.dmg)` | ||
|
||
// RegexWindows is a regular express for windows systems | ||
var RegexWindows = `(?i)(windows|win)` | ||
var RegexWindows = `(?i)(windows|win|.msi|.exe|.appx)` | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you remove .dmg
and .appx
? Don't think these help because even if you can download them you want be able to properly install these formats through stew.
@@ -189,7 +191,7 @@ func DetectAsset(userOS string, userArch string, releaseAssets []string) (string | |||
} | |||
} | |||
if finalAsset == "" { | |||
finalAsset, err = WarningPromptSelect("Could not automatically detect the release asset matching your OS/Arch. Please select it manually:", filteredReleaseAssets) | |||
finalAsset, err = WarningPromptSelect("Could not automatically detect the release asset matching your OS/Arch. Please select it manually:", detectedFinalAssets) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think if filtering fails, I'd rather be conservative and show the user everything, so could you please revert this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok
But can we add some logic around interactive and non-I reactive terminals? I use stew in docker installations and “I will show you everything” is not working well in this scenario
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes it can be an option, but everybody will forget it on a first run. Just like -y is always forgotten in “apt install package“ in scripts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For non-interactive installs, you should be installing from a Stewfile.lock.json
.
stew install Stewfile.lock.json
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Eh. It will not work this way. I'm on Mac, my container is linux and maybe on different architecture
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does presenting users with a filtered list of options here help with non-interactive installs?
re := regexp.MustCompile(`\.(sha(256|512)(sum)?)$`) | ||
|
||
for _, asset := range assets { | ||
if strings.HasSuffix(asset, ".sha256") { | ||
if re.MatchString(asset) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you move this to the constants.go
file? Include a comment like:
// RegexChecksum is a regular expression for matching checksum files
var RegexChecksum = `\.(sha(256|512)(sum)?)$`
Merged in your commit + small changes in #65 Thank you for your contribution!! |
Before:
After:
uname -a Darwin m 24.0.0 Darwin Kernel Version 24.0.0: Tue Sep 24 23:37:13 PDT 2024; root:xnu-11215.1.12~1/RELEASE_ARM64_T8112 x86_64