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

Add support for zip archive type for Windows and macOS #1

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

Conversation

frsyuki
Copy link

@frsyuki frsyuki commented Jan 11, 2024

I installed https://github.com/sqldef/sqldef-rails and ran bundle exec rake db:schema:dump today. It caused errors due to following 3 reasons:

  • Etc.uname == 'arm64' is not expected. Error message:
KeyError: key not found: "arm64"
  • sqldef repository is moved from k0kubun to sqldef on github. Thus GitHub made one additional redirect. Error message:
Expected 'https://github.com/k0kubun/sqldef/releases/latest/download/psqldef_darwin_arm64.zip' to return 302, but got 301:
  • Binary releases are archived in zip format for windows and darwin. Error message:
Zlib::GzipFile::Error: not in gzip format

This PR fixes the errors and makes the sqldef-rails working on macOS.

Environment:

  • macOS 12.7.2
  • MacBook Pro, Apple M1
  • Output of uname -m:
$ uname -m
arm64
$ which uname
/opt/homebrew/opt/coreutils/libexec/gnubin/uname
$ /usr/bin/uname -m
arm64

Binary releases at https://github.com/sqldef/sqldef use tar.gz for linux
while zip for windows and darwin.
Github returns an additional 302 to follow the repository move which
had made the downloading code broken.
This change is optional as long as the repository is kept at
sqldef/sqldef and GitHub doesn't change how it redirects but works as a
nice safeguard.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant