lefthook icon indicating copy to clipboard operation
lefthook copied to clipboard

Install Lefthook using a package manager in Windows

Open SAGARSURI opened this issue 3 years ago • 15 comments

Is there a way to install lefthook on Windows using chocolatey package manager or winget? I want to write a bash script to automate this process of installing lefthook on my machine and other teammates.

SAGARSURI avatar Jul 14 '20 07:07 SAGARSURI

@SAGARSURI Hi, you could add lefthook in any package manager you want, like here for python: https://github.com/life4/lefthook

Arkweid avatar Jul 15 '20 07:07 Arkweid

Hey @Arkweid , Is it possible to add the .exe file in the asset of the release notes? I am planning to open up a PR for the winget package manager. They expect to mention the type of installer while submitting the PR.

Currently, we have only .zip file to download and extract it to get the .exe file.

SAGARSURI avatar Jul 16 '20 07:07 SAGARSURI

Oke, I will add unzipped file in next release.

Arkweid avatar Jul 17 '20 16:07 Arkweid

Thank you so much! @Arkweid

SAGARSURI avatar Jul 18 '20 08:07 SAGARSURI

I have added this to my JIRA ticket and will resume work once this is done. 😄

SAGARSURI avatar Jul 27 '20 06:07 SAGARSURI

On Windows 1803 or later, you can use Unix curl with curl (in CMD) or curl.exe (in PowerShell). So when unzipped files are added to the release, you can install lefthook with the same commands in both Windows and Unix (although you have to change the download URL and set the PATH) 🎉

ahuglajbclajep avatar Aug 30 '20 05:08 ahuglajbclajep

It does not appear exe ever started getting published. @Envek could this be added for next release?

bbodenmiller avatar Apr 30 '21 09:04 bbodenmiller

Since v0.7.4 non-compressed binaries are attached to releases.

@bbodenmiller @SAGARSURI @ahuglajbclajep please enjoy.

Envek avatar Apr 30 '21 12:04 Envek

Thank you so much @Envek

SAGARSURI avatar Apr 30 '21 12:04 SAGARSURI

This is counterintuitive. You should probably use a better package manager. For example, Chocolatey is able to unzip files without any issues. https://docs.chocolatey.org/en-us/create/functions/install-chocolateyzippackage

aminya avatar May 15 '21 10:05 aminya

Why should we use Chocolatey when Microsoft provide a default package manager i.e winget. It provides better security compared to other 3rd party package manager.

SAGARSURI avatar May 22 '21 03:05 SAGARSURI

Why should we use Chocolatey when Microsoft provide a default package manager i.e winget. It provides better security compared to other 3rd party package manager.

I'm very sorry to see this attitude toward community-driven open-source projects. A 3rd party project is not insecure by default, and Microsoft projects are not any more secure. Instead, I suggest you decide based on the actual technical differences. For example, if a package manager lacks its basics such as installing zip files or if it allows decentralized packages.

P.S: since this is offtopic, I will not continue this discussion after this comment.

aminya avatar May 22 '21 17:05 aminya

We want to support as many installations methods as possible (however, using as least effort as possible). So, let's add support to both (pull requests are welcome)

Envek avatar May 24 '21 12:05 Envek

Chocolatey is the defacto (winget is newer), but for Go packages I'd suggest Scoop. Goreleaser has built in configuration to support Scoop. I've written chocolatey packages and it's not as straight forward. Between Scoop, go install, and npm install you've covered a nice set of install options.

https://goreleaser.com/customization/scoop/

sheldonhull avatar Jul 31 '21 03:07 sheldonhull

I would also love to have this installable via Scoop. I have some experience with GoReleaser so let me know if help is needed.

nikoheikkila avatar May 13 '22 18:05 nikoheikkila

I would also love to have this installable via Scoop. I have some experience with GoReleaser so let me know if help is needed.

Now available in Scoop via the Main bucket:

  • https://github.com/ScoopInstaller/Main/pull/4967

GoReleaser is no longer needed as the bucket auto-updates the manifest itself.

Lefthook is now available in Winget as well: https://github.com/microsoft/winget-pkgs/pull/112810. The Winget Releaser action should be used to keep it up-to-date:

  • #526

sitiom avatar Jul 22 '23 08:07 sitiom

@sitiom , thank you a lot! ❤️🔥

mrexox avatar Jul 22 '23 08:07 mrexox