Ph0enixKM / Amber

💎 Amber the programming language compiled to bash
https://amber-lang.com
GNU General Public License v3.0
3.53k stars 70 forks source link

✨ Amber Updater #145

Open brumik opened 4 weeks ago

brumik commented 4 weeks ago

Make so that Amber can update itself.

brumik commented 4 weeks ago

I was thinking of two possible ways to do it:

CLI command option:

amber --check-version

Current version: 1.0.0
Latest version: 1.2.0

Run amber --update to get the latest version

Manual command option:

amber ---check-version

Current version: 1.0.0
Latest version: 1.2.0

To update amber run:

curl -s "https://raw.githubusercontent.com/Ph0enixKM/AmberNative/master/setup/update.sh" | /usr/bin/env bash
b1ek commented 4 weeks ago

shouldn't this kind of thing be done via the system's package manager?

brumik commented 4 weeks ago

I expect so if you installed it from one. Currently we have a script that is the "recommended" (or for most systems only) way to do it. So as I understood the task from the project we want something like this.

Ph0enixKM commented 4 weeks ago

Well this is a good question. When Amber was first created I was not focusing on maintaining packages. Now since there are propositions to maintain Amber via Homebrew tap or AUR packages - this could be unnecessary.

However... I still think that Amber should at least inform the user about new updates in some way and it should instruct them on how to update it.

I think that this issue should at least cover the ability to check the latest version. If do something like --check-version it should fetch the latest version available.

b1ek commented 4 weeks ago

inform the user about new updates

when would be the right time to do this, though? sending an HTTP request somewhere each compilation seems very unnecessary and time consuming. also the users might not like the excessive telemetry

i cant really think of a language/compiler/interpreter that informs the user about a new update tbh

Ph0enixKM commented 4 weeks ago

I think that creating brew tap, PPA repository etc. Would be of higher priority right now. We should discuss that more on GH Discussions

Ph0enixKM commented 4 weeks ago

when would be the right time to do this, though? sending an HTTP request somewhere each compilation seems very unnecessary and time consuming. also the users might not like the excessive telemetry

@b1ek This could happen when user checks the compiler version. Although I'm not sure if people would be against that. We can always just leave the --check-version or --latest to get the latest version by itself. Not necessarily try to hide or sneak some telemetry behind the scenes.