jpillora / installer

One-liner for installing binaries from Github releases
https://i.jpillora.com/installer
MIT License
206 stars 52 forks source link

Improve architecture to: simplify codebase, serve private binaries, install-by-file-url #31

Open jpillora opened 1 year ago

jpillora commented 1 year ago

I think the architecture should be changed from returning 1 complex shell script into 2 simple shell scripts:

curl <installer ip address>/myuser/myrepo

should return a simple script which fetches all of the OS information it can, and then repeats the call (Protocol + Host + path) except the call has extra fields added:

curl <installer ip address>/myuser/myrepo?os=linux&arch=arm64&tools=unzip,tar,gz

now that it has the minimum info (os arch tools) it can now do the checks in Go, and return a simple script which is effectively 1. curl to /tmp, 2. optional unpack, 3. chmod +x, 4. optionally mv to PATH. all the complex shell logic will move into go. second simple shell script does a minimal download and install. errors are just a one-liner echo "my error..."

subsequent improvements:

caveat: