From 6bc8621a503a1372f2c534f2b99485e9d0ec9329 Mon Sep 17 00:00:00 2001 From: Ian Kelling Date: Wed, 22 Jun 2016 10:43:46 -0700 Subject: [PATCH] add local option to support local development --- get-wiki-snapshot | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/get-wiki-snapshot b/get-wiki-snapshot index b71c9ec..578732b 100755 --- a/get-wiki-snapshot +++ b/get-wiki-snapshot @@ -6,17 +6,20 @@ trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR cd "${BASH_SOURCE%/*}" + script_file=mw-setup-script page_file=Mediawiki_Setup_Guide start=' * *' end=' *<\/source> *' -ruby <<'EOF' > $page_file +if [[ $1 != -l ]]; then # use local file + ruby <<'EOF' > $page_file require 'json' puts JSON.parse(`curl -k 'https://ofswiki.org/w/api.php?\ action=query&titles=Mediawiki_Setup_Guide&prop=revisions&rvprop=content&\ format=json'`.chomp)['query']['pages'].values[0]['revisions'][0]['*'] EOF +fi { cat <<'EOF' #!/bin/bash -- 2.30.2