Skip to content

Commit c604df8

Browse files
decentral1sejaspervdj
authored andcommitted
Add scripts to run with pipe recipe.
Closes #194.
1 parent 258b471 commit c604df8

File tree

3 files changed

+34
-0
lines changed

3 files changed

+34
-0
lines changed

README.markdown

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,15 @@ Atom integration
149149
[ide-haskell]: https://atom.io/packages/ide-haskell
150150
[atom-beautify]: Https://atom.io/packages/atom-beautify
151151

152+
Using with Continuous Integration
153+
---------------------------------
154+
155+
You can quickly grab the latest binary and run `stylish-haskell` like so:
156+
157+
curl -sL https://raw.github.com/jaspervdj/stylish-haskell/master/scripts/latest.sh | sh -s .
158+
159+
Where the `.` can be replaced with the arguments you pass to `stylish-haskell`.
160+
152161
Credits
153162
-------
154163

scripts/latest.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/sh
2+
# Ported from https://raw.githubusercontent.com/ndmitchell/neil/master/misc/travis.sh
3+
4+
set -e
5+
6+
PACKAGE=stylish-haskell
7+
echo Downloading and running $PACKAGE...
8+
9+
RELEASES=$(curl --silent https://github.com/jaspervdj/$PACKAGE/releases)
10+
URL=https://github.com/$(echo $RELEASES | grep -o '\"[^\"]*-x86_64-linux\.tar\.gz\"' | sed s/\"//g | head -n1)
11+
VERSION=$(echo $URL | sed -e 's/.*-\([\.0-9]\+\)-x86_64-linux\.tar\.gz/\1/')
12+
TEMP=$(mktemp --directory .$PACKAGE-XXXXX)
13+
14+
cleanup(){
15+
rm -r $TEMP
16+
}
17+
trap cleanup EXIT
18+
19+
curl --progress-bar --location -o$TEMP/$PACKAGE.tar.gz $URL
20+
tar -xzf $TEMP/$PACKAGE.tar.gz -C$TEMP
21+
$TEMP/$PACKAGE-$VERSION/$PACKAGE $*

scripts/stylish-haskell.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
# Ported from https://github.com/ndmitchell/hlint/blob/master/misc/travis.sh
3+
4+
curl -sL https://raw.github.com/jaspervdj/stylish-haskell/master/scripts/latest.sh | sh -s -- stylish-haskell $*

0 commit comments

Comments
 (0)