Last active
June 17, 2018 12:47
-
-
Save ahebrank/7c0197d1d7bf1c3173bc9d6a3078938d to your computer and use it in GitHub Desktop.
Get the DHIS2 visualizer/embed scripts since the CDN no longer works
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # destination folder | |
| SCRIPT_DIR=$( pwd )/../assets/js/dhis2 | |
| # dhis2 version | |
| VERSION=2.28 | |
| # download URL pattern from https://www.dhis2.org/downloads | |
| DOWNLOAD_URL=https://s3-eu-west-1.amazonaws.com/releases.dhis2.org/$VERSION/dhis.war | |
| if [ ! -d $SCRIPT_DIR ]; then | |
| echo "$SCRIPT_DIR (SCRIPT_DIR) not found" | |
| exit 1 | |
| fi | |
| if [ ! -d $TMPDIR ]; then | |
| echo "$TMPDIR (TMPDIR) not found" | |
| exit 1 | |
| fi | |
| cd $TMPDIR | |
| rm -rf dhis2 && mkdir dhis2 && cd dhis2 | |
| curl $DOWNLOAD_URL -o dhis.war | |
| jar -xvf dhis.war | |
| rm -rf $SCRIPT_DIR/* | |
| cp -R dhis-web-visualizer $SCRIPT_DIR/ | |
| cp -R dhis-web-mapping $SCRIPT_DIR/ | |
| cp -R dhis-web-pivot $SCRIPT_DIR/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment