GitHub - benweissmann/getmic.ro: The fastest way to install Micro (original) (raw)

Test

The fastest way to install Micro

local install just for your user

curl https://getmic.ro | bash

Or, using wget in place of curl and any shell interpreter in place of bash:

local install just for your user

wget -O- https://getmic.ro | sh

This script will install micro to the directory you're in. To install somewhere else (e.g. /usr/local/bin), cd there and make sure you can write to that directory, e.g. cd /usr/local/bin; curl https://getmic.ro | sudo sh like so:

global install for all users

cd /usr/bin curl https://getmic.ro | sudo sh

This script can also use update-alternatives to register micro as a system text editor. For example, this will allow crontab -e open the cron file with micro.

To enable this feature, define the GETMICRO_REGISTER variable or use the URLhttps://getmic.ro/r. Note that you must install micro to a directory accessible to all users when doing this, typically /usr/bin:

global install for all users, registering with update-alternatives

cd /usr/bin curl https://getmic.ro/r | sudo sh

Vous ne comprenez pas l'anglais? vous parlez français? Regardez le LISEZ-MOI français!

Advanced usage

There's a couple other things you can do with getmic.ro. Listed below are environment variables you can choose from:

Putting it all together, the following command line would always use wget, always install the linux32 binaries, and always register with update-alternatives:

wget -O- https://getmic.ro | GETMICRO_HTTP="wget -O-" GETMICRO_PLATFORM=linux32 GETMICRO_REGISTER=y sh

Verify the script checksum

To verify the script, you can download it and checksum it. The sha256 checksum is d041f51b97871dc7de1f01879c12a978b074a5acdb6528e884ce8f4c05d2ad35.

gmcr="$(curl https://getmic.ro)" && [ (echo"(echo "(echo"gmcr" | shasum -a 256 | cut -d' ' -f1) = d041f51b97871dc7de1f01879c12a978b074a5acdb6528e884ce8f4c05d2ad35 ] && echo "$gmcr" | sh

Alternatively, you can use the following manual method.

1. Manually verify that this outputs d041f51b97871dc7de1f01879c12a978b074a5acdb6528e884ce8f4c05d2ad35

curl https://getmic.ro | shasum -a 256

2. If #1 was successful, then execute getmicro

curl https://getmic.ro | sh

Contributing

Thank you for contributing! We use the Github pull request workflow: fork this repo, make your changes, and then submit a pull request. There's a couple things you'll need to do to get your PR merged:

If you're not sure how to do any of these things, feel free to open a PR with your work-in-progress and whatever questions you have!

Acknowledgments: