Skip to content
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

feat: Override default build format to Zip when building for Windows #527

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

felipebraga
Copy link

Override default build format to Zip when building for Windows

The idea behind it is to enable winget installation due the inability of winget decompress tar files.

Copy link
Collaborator

@yermulnik yermulnik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

> git br
* pr/527
  master

> goreleaser check
  • checking                                 path=.goreleaser.yml
  • 1 configuration file(s) validated
  • thanks for using goreleaser!

Comment on lines +7 to +8


Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Out of interest: why these two new blank lines?

Copy link
Collaborator

@yermulnik yermulnik Dec 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

other than that PR looks good to me

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yermulnik
Copy link
Collaborator

@felipebraga While you're here, could you please trim trailing whitespaces in this file on line 29? Thanks in advance.
image

@MatthewJohn
Copy link
Collaborator

Assuming that windows is in a state that can run shell scripts (I guess cygwin or such), then we need to consider the install script: https://github.com/warrensbox/terraform-switcher/blob/master/install.sh#L345 as it looks for the tar.gz

@yermulnik
Copy link
Collaborator

Assuming that windows is in a state that can run shell scripts (I guess cygwin or such), then we need to consider the install script: master/install.sh#L345 as it looks for the tar.gz

Ah, good pointer.
Given the script already supports zip, we should be good to adjust FORMAT conditionally via https://github.com/warrensbox/terraform-switcher/blob/master/install.sh#L89-L92 like it's already done somewhere else, e.g. https://github.com/LilithGames/golangci-lint/blob/master/install.sh#L120-L126

The change looks quite simple, though I don't have Windows laptop to test 🤷🏻

@felipebraga Could you please implement this change and test install.sh script to work as expected on Windows? 🤔

Copy link
Collaborator

@yermulnik yermulnik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requesting changes as install script needs to be adjusted accordingly.

@MatthewJohn
Copy link
Collaborator

MatthewJohn commented Dec 21, 2024

Assuming that windows is in a state that can run shell scripts (I guess cygwin or such), then we need to consider the install script: master/install.sh#L345 as it looks for the tar.gz

Ah, good pointer. Given the script already supports zip, we should be good to adjust FORMAT conditionally via https://github.com/warrensbox/terraform-switcher/blob/master/install.sh#L89-L92

I did see that, the comment seems weird though: # change format (tar.gz or zip) based on ARCH

Seems to suggest that format can be changed based on architecture, but archive name can be changed based on OS 🤔

Edit: Ah yeh, that second example implies it should work fine 🥳

@yermulnik
Copy link
Collaborator

I did see that, the comment seems weird though: # change format (tar.gz or zip) based on ARCH

Seems to suggest that format can be changed based on architecture, but archive name can be changed based on OS 🤔

Edit: Ah yeh, that second example implies it should work fine 🥳

Yeah, that seems to be a copy-pasta typo that comes from someone else's original script I guess that is used across multiple repos and is based on portable POSIX libs collection at https://github.com/client9/shlib

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants