File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6,4 +6,22 @@ The perfect OAS (Swagger 2) companion. Turn any OAS file into an API server with
66
77[ Documentation - https://designer.stoplight.io/docs/prism ] ( https://designer.stoplight.io/docs/prism?utm_source=github&utm_medium=prism )
88
9- Downloads available over in [ releases] ( https://github.com/stoplightio/prism/releases ) .
9+ ## Installation
10+
11+ On OS X or Linux:
12+
13+ ```
14+ curl https://raw.githubusercontent.com/stoplightio/prism/master/install.sh | sh
15+ ```
16+
17+ On Windows download [ binary] ( https://github.com/stoplightio/prism/releases ) .
18+
19+ ## Update
20+
21+ ```
22+ prism update
23+ ```
24+ or
25+ ```
26+ prism up
27+ ```
Original file line number Diff line number Diff line change 1+ #! /bin/sh
2+
3+ install () {
4+
5+ set -eu
6+
7+ UNAME=$( uname)
8+ ARCH=$( uname -m)
9+ if [ " $UNAME " != " Linux" ] && [ " $UNAME " != " Darwin" ] && [ " $ARCH " != " x86_64" ] && [ " $ARCH " != " i686" ]; then
10+ echo " Sorry, OS/Architecture not supported: ${UNAME} /${ARCH} . Download binary from https://github.com/stoplightio/prism/releases"
11+ exit 1
12+ fi
13+
14+ if [ " $UNAME " = " Darwin" ] ; then
15+ OSX_ARCH=$( uname -m)
16+ if [ " ${OSX_ARCH} " = " x86_64" ] ; then
17+ PLATFORM=" darwin_amd64"
18+ fi
19+ elif [ " $UNAME " = " Linux" ] ; then
20+ LINUX_ARCH=$( uname -m)
21+ if [ " ${LINUX_ARCH} " = " i686" ] ; then
22+ PLATFORM=" linux_386"
23+ elif [ " ${LINUX_ARCH} " = " x86_64" ] ; then
24+ PLATFORM=" linux_amd64"
25+ fi
26+ fi
27+
28+ LATEST=$( curl -s https://api.github.com/repos/stoplightio/prism/tags | grep -Eo ' "name":.*?[^\\]",' | head -n 1 | sed ' s/[," ]//g' | cut -d ' :' -f 2)
29+ URL=" https://github.com/stoplightio/prism/releases/download/$LATEST /prism_$PLATFORM "
30+ DEST=/usr/local/bin/prism
31+
32+ if [ -z $LATEST ] ; then
33+ echo " Error requesting. Download binary from ${URL} "
34+ exit 1
35+ else
36+ curl -sL $URL -o $DEST
37+ chmod +x $DEST
38+ fi
39+ }
40+
41+ install
You can’t perform that action at this time.
0 commit comments