Skip to content

Instantly share code, notes, and snippets.

@zyedidia
Last active October 23, 2017 07:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zyedidia/d4acfcc6acf2d0d75e79004fa5feaf24 to your computer and use it in GitHub Desktop.
Save zyedidia/d4acfcc6acf2d0d75e79004fa5feaf24 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
set -e
OS=$1
INSTALLDIR=${2:-"."}
function githubLatestTag {
finalUrl=`curl https://github.com/$1/releases/latest -s -L -I -o /dev/null -w '%{url_effective}'`
echo "${finalUrl##*v}"
}
TAG=`githubLatestTag zyedidia/micro`
echo "Downloading https://github.com/zyedidia/micro/releases/download/v$TAG/micro-$TAG-"$OS".tar.gz"
curl -L "https://github.com/zyedidia/micro/releases/download/v$TAG/micro-$TAG-"$OS".tar.gz" > micro.tar.gz
tar -xvf micro.tar.gz "micro-$TAG/micro"
rm micro.tar.gz
echo "mv micro-$TAG/micro $INSTALLDIR/micro"
mv micro-$TAG/micro $INSTALLDIR/micro
rm -rf micro-$TAG
@henri-hulski
Copy link

I get the following error when running this script in Debian:

root@openhomeo:~# bash ./install_micro.sh linux64 /usr/local/bin/
  File "<string>", line 15
    print versions[0][1:]
                 ^
SyntaxError: Missing parentheses in call to 'print'

@henri-hulski
Copy link

This looks like a Python 3 error. I have Python 3.5 as default Python.
But no idea where is here a Python script.

@zyedidia
Copy link
Author

The old link in the wiki in the install command linked to a previous version of this script which used python. It has been updated now (sorry I didn't see your comment until now).

@Noammac
Copy link

Noammac commented May 26, 2017

Any chance for a nightly version as well?

@haslinger
Copy link

Currently, the script fails for me on Ubuntu 14.04 with:

tar: This does not look like a tar archive
gzip: stdin: not in gzip format
tar: Child returned status 1
tar: Error is not recoverable: exiting now

@hristian-carabulea
Copy link

Hello. I also got an error message on Lubuntu 17.04:
./install_micro.sh
Downloading https://github.com/zyedidia/micro/releases/download/v1.3.3/micro-1.3.3-.tar.gz
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 9 0 9 0 0 15 0 --:--:-- --:--:-- --:--:-- 15
tar: This does not look like a tar archive

gzip: stdin: not in gzip format
tar: Child returned status 1
tar: Error is not recoverable: exiting now

Thanks.

@oct2pus
Copy link

oct2pus commented Oct 23, 2017

Repeating what the last two said, I get the same error.

Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package gzip2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment