sobolevn / git-secret

:busts_in_silhouette: A bash-tool to store your private data inside a git repository.
https://sobolevn.me/git-secret/
MIT License
3.73k stars 198 forks source link

Installing via npm / yarn #576

Closed aymericbouzy closed 4 years ago

aymericbouzy commented 4 years ago

Would it be possible to install git-secret with npm?

Benefits :

Maybe https://www.npmjs.com/package/git-secret is the same package already after all?

joshrabinowitz commented 4 years ago

Hello @aymericbouzy

I don't know the answer to your question, but I don't think it makes sense to install the bash version of git-secret using npm (maybe someone can correct me here).

Also the package at https://www.npmjs.com/package/git-secret appears to be a completely different system than this original version of git-secret by @sobolevn, which is sure to cause confusion in the wild.

I've reached out to the author of the npmjs package you link to above to see if we can sync up. Thanks for making us aware.

joshrabinowitz commented 4 years ago

@sobolevn this thread may be of interest to you

sobolevn commented 4 years ago

I completely agree with @joshrabinowitz

It does not make much sense to use npm for bash apps. Maybe we will change our opinion after rust version is out.

aymericbouzy commented 4 years ago

Just to explain why I thought it might be nice : previously, to get people started on my project, I simply had to tell them "run npm install and you're good to go!". It made a number of cli available such as :

Now the installation steps are OS dependent and it is required to run a number of different commands.

sobolevn commented 4 years ago

This is a valid use-case, I agree. But, there's nothing we can do from our side right now.

Because:

  1. We cannot support npm alone. Why not supporting pip, cargo, hex, cabal and other package managers then?
  2. We cannot really be a js package. Because git-secret cannot be imported. We do not guarantee that it will work this way.
  3. npm scripts are also OS-related, it is just hidden from the end user
joshrabinowitz commented 4 years ago

Related: there was briefly an npm package called git-secret, but it has been deprecated and now refers to this project and git repo. See https://www.npmjs.com/package/git-secret?activeTab=versions

aymericbouzy commented 4 years ago

Update: I just realised homebrew can be installed on Linux (and Windows using WSL): so this seems the easiest path...

sobolevn commented 4 years ago

Oh, wow! You can contribute this part to the Homebrew docs!

aymericbouzy commented 4 years ago

I just realised homebrew can be installed on Linux (and Windows using WSL): so this seems the easiest path...

Actually it's so slow ....... it works, but I cannot spend more time installing git-secret than building my project on CI 😅

So I just tried to install from source, and:

  1. it works right away.
  2. it's really fast

So that's my new favorite install method 😄

git clone https://github.com/sobolevn/git-secret.git git-secret
(cd git-secret && make build && PREFIX="/home/rof" make install)

Note: I installed to /home/rof on Codeship Basic because I don't have the write to edit /usr/local. I'm not sure what this folder is for, I just tried a random one in the list in my $PATH 😅