Comments (8)
I like the idea to extract all files from a given archive. My question is, what would be the location, where the archive gets extracted.
Before I discovered bin
, I started to implement something similar. In my tool I used three different folders:
- a cache dir, where I kept the downloaded archives (this is not strictly necessary), for this I used a sub directory in the folder returned from
os.UserCacheDir()
by default. - a share dir, where I extracted the downloaded archives, for this I used a sub directory in
path.Join(os.UserHomeDir(), ".local", "share", "<tool name>")
. Every archive go extracted into its own directory, composed from the name of the tool (binary) and the version. - Instead of copying the binary to the bin-dir (in my case
path.Join(os.UserHomeDir(), "bin")
, I decided to symlink the binary file in the share dir to the bin dir.
Just my 2 cts.
from bin.
This is my understanding so far about what Bin does:
-
Bin currently reads the "source" file into memory, so there is no file-based-caching of the source download
-
Bin already takes a parameter that is used as the "install directory", so the unarchived files would be sent there (or if that parameter isn't provided, to the default directory that is selected the first time Bin is run)
eg:
bin install github.com/marcosnils/bin D:\install\dir
Will install the executable to the directory: D:\install\dir -
This sounds like you're not providing the [install directory] parameter, so all of your "installs" are being directed to the bin directory that was set the very first-time Bin was run. (if you rename
~/.bin/config.json
and re-run Bin then it will prompt you for the "default" install location, just remember to delete the new config.json generated and replace your original file, or bin will lose track of all your current installs).
In another post (#54) I've requested to move the "install directory" parameter into a flagged parameter (--installdir=
). Basically, using the Cobra addon paradigm of all "optional" values being provided via flagged parameters, and then using any non-flagged argument in-place of any input that would otherwise come from stdin. This would break some backwards compatibility, so I've asked the dev if they have any idea of the impact of moving the current 3rd argument (install directory) to a flagged parameter instead.
from bin.
I will let @marcosnils decide on this matter, but my impression from the README.md is that bin
is centered around "the popularity of single binary releases due to the surge of languages like Go, Rust, Deno, etc which can easily produce dynamically and statically compiled binarines."
Supporting multiple files, dependencies, etc. sounds like a wider/different scope. What do you think, @marcosnils?
from bin.
@sirlatrom I agree with you, that supporting dependencies would be a completely different beast to tackle. But extracting all files from an release archive to a target folder instead of just extracting the binary wouldn't be difficult. This could easily be done by an additional step, when the archive is extracted in memory and it could be controlled by a flag.
As mentioned also in #71, sometimes the binary is not everything that is needed, because there might be other files, that are used together with the binary (e.g. templates, config files, etc.). There is also the question around the license. Some open source licenses require the binary to be shipped with the license. In this case it might even be a violation of the license to only extract the binary.
from bin.
Just to give an example, installing cue with bin install github.com/cuelang/cue
misses a lot of valuable documentation.
from bin.
Just to give an example, installing cue with
bin install github.com/cuelang/cue
misses a lot of valuable documentation.
@breml I can see that getting that content extracted somewhere would be valuable, but what when you install the next tool that also has a doc
sub-directory in the release asset archive?
So far, bin
has only managed individual binaries with one file in a target location per source, with the result that the binary you've downloaded ends up in your $PATH
.
from bin.
@sirlatrom My idea is to extract the archives e.g. into ~/.local/share/bin/<binary-name>-<version>
. In the tool I started coding I then linked the binary to e.g. ~/bin
, so this file is not stored twice on disk. Of course, for Windows we would need to workaround this.
For now, bin
does not really care about versions, so the content of the archive could be extracted to ~/.local/share/bin/<binary-name>
. Whenever an update for a binary happens, the complete folder would be removed an recreated with the content of the new archive.
from bin.
It would be lovely if this could be implemented. It happened to me yesterday that I wanted to install some release with multiple files in zip archive. If bin could handle this kind of releases I would be assured that that they continue to be tracked for updated.
from bin.
Related Issues (20)
- Manpages placed incorrectly HOT 7
- [Request] Additonal installation method HOT 2
- Changing default download location HOT 1
- feat: Exclude a package from update HOT 3
- Allow `ensure` to accept binary parameter, as done in `update` HOT 12
- shorter bin install command
- Question: How to download kubens from kubectx? HOT 4
- Freeze Version HOT 4
- Filter logic not working properly for helix HOT 9
- Ability to set aliases of a downloaded binary file HOT 2
- Can't remove a binary installed to the relative path HOT 5
- Allow to install all binaries
- Remeber the chosen option of mutiple matches on updating HOT 3
- bin install docker:// does not work except with /var/run/docker.sock
- Powershell: Ignore .sha256 and .msi
- bin update fails (error=binary path not found) HOT 2
- Provide a cli command to download the latest release of the `bin` directly HOT 4
- bin unable to update itself in Powershell HOT 3
- Install packages/binaries from a file containing a list of packages with pinned versioning (e.g. `bin ls > binfile`, then `bin i ./binfile` HOT 2
- feature: implement hooks
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bin.