Skip to content

Instantly share code, notes, and snippets.

@stefanvangastel
Created February 5, 2018 19:39
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 stefanvangastel/34ace6a697d2e7ac0fb07e9194b94b1a to your computer and use it in GitHub Desktop.
Save stefanvangastel/34ace6a697d2e7ac0fb07e9194b94b1a to your computer and use it in GitHub Desktop.
Download latest release of Draw.io as war file
#!/bin/bash
json=`curl -s -X GET https://api.github.com/repos/jgraph/drawio/tags`
temp=`echo $json | sed 's/\\\\\//\//g' | sed 's/[{}]//g' | awk -v k="text" '{n=split($0,a,","); for (i=1; i<=n; i++) print a[i]}' | sed 's/\"\:\"/\|/g' | sed 's/[\,]/ /g' | sed 's/\"//g' | grep -w 'name'`
version="$(echo $temp | cut -d\ -f3)"
curl -o "drawio-$version.war" -L https://github.com/jgraph/drawio/releases/download/$version/draw.war
@STROMANZ
Copy link

STROMANZ commented Feb 7, 2018

#!/bin/bash

OPS VS DEV!

version=$(curl -Ls -o /dev/null -w %{url_effective} https://github.com/jgraph/drawio/releases/latest | awk -F/ '{print $NF}')
curl -o "drawio-$version.war" -L https://github.com/jgraph/drawio/releases/download/$version/draw.war

@stefanvangastel
Copy link
Author

Baas...

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