browsh/interfacer/contrib/setup_browsh.sh

26 lines
956 B
Bash
Raw Normal View History

2018-01-28 07:26:37 +00:00
#!/bin/bash
# I suspect this will be mostly used by automated CI.
# For example; in creating the Browsh Docker image. We don't actually build
# Browsh in the Dockerfile because that would require signing the webextension
# again, which can't be done as only one canonical release of a webextension is
# allowed by MDN per semantic version. It's actually quite good to not have to
2018-02-02 09:20:37 +00:00
# repeat the build process (having done so in Travis after successfully
# passing tests). So we simply just download the already built binary.
2018-01-28 07:26:37 +00:00
2018-02-02 09:20:37 +00:00
if [ ! -f manifest.json ]; then
PROJECT_ROOT=$(git rev-parse --show-toplevel)/webext
2018-01-28 07:26:37 +00:00
else
2018-02-02 09:20:37 +00:00
PROJECT_ROOT=.
2018-01-28 07:26:37 +00:00
fi
2018-02-02 09:20:37 +00:00
manifest=$PROJECT_ROOT/manifest.json
2018-01-28 07:26:37 +00:00
line=$(cat $manifest | grep '"version"')
version=$(echo $line | grep -o '".*"' | cut -d " " -f 2 | sed 's/"//g')
2018-01-28 08:13:13 +00:00
base='https://github.com/tombh/texttop/releases/download'
release_url="$base/v$version/browsh_${version}_linux_amd64"
2018-01-28 07:26:37 +00:00
curl -L -o browsh $release_url
chmod a+x browsh