File tree Expand file tree Collapse file tree 12 files changed +40
-65
lines changed
implementations/Bash_JSONPath.sh Expand file tree Collapse file tree 12 files changed +40
-65
lines changed Original file line number Diff line number Diff line change @@ -18,10 +18,7 @@ <h4 id="Bash_JSONPath.sh">
1818Bash (JSONPath.sh)
1919</ h4 >
2020
21- < pre > < code > [
22- 42,
23- 21
24- ]
21+ < pre > < code > []
2522</ code > </ pre >
2623
2724< h4 id ="Clojure_json-path ">
Original file line number Diff line number Diff line change @@ -70,7 +70,9 @@ <h4 id="Bash_JSONPath.sh">
7070Bash (JSONPath.sh)
7171</ h4 >
7272
73- < pre > < code > []
73+ < pre > < code > [
74+ 1
75+ ]
7476</ code > </ pre >
7577
7678< h4 id ="C_json-glib ">
Original file line number Diff line number Diff line change @@ -70,7 +70,9 @@ <h4 id="Bash_JSONPath.sh">
7070Bash (JSONPath.sh)
7171</ h4 >
7272
73- < pre > < code > []
73+ < pre > < code > [
74+ 1
75+ ]
7476</ code > </ pre >
7577
7678< h4 id ="C_json-glib ">
Original file line number Diff line number Diff line change @@ -2,8 +2,8 @@ root = implementations/Bash_JSONPath.sh
22builddir = $root /build
33
44rule install
5- command = (cd $root && npm install) && echo > $out
5+ command = rm -rf $out && $root / install.sh $out
66
7- build $builddir/node_modules_installed : install | $root/package.json $root/package-lock.json
7+ build $builddir/JSONPath.sh : install | $root/install.sh $root/tag
88
9- build $root/install : phony $builddir/node_modules_installed
9+ build $root/install : phony $builddir/JSONPath.sh
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ test_gnu_compat() {
1212 >&2 echo " Make sure you have GNU coreutils installed"
1313 fi
1414
15- if grep --version & > /dev/null && grep --version | grep ' BSD' & > /dev/null; then
15+ if grep --version | grep ' BSD' & > /dev/null; then
1616 error=1
1717 >&2 echo " Make sure you have GNU grep or compatible installed"
1818 fi
@@ -22,18 +22,22 @@ test_gnu_compat() {
2222 >&2 echo " Make sure you have GNU sed or compatible installed"
2323 fi
2424
25- if [[ $error -gt 0 && is_osx ]] ; then
25+ if [[ $error -gt 0 ]] && is_osx; then
2626 >&2 echo " With homebrew you may install necessary deps via \` brew install grep gnu-sed coreutils\` "
27+ >&2 echo ' Put /opt/homebrew/bin/gsed early in your PATH'
28+ >&2 echo ' Then put /opt/homebrew/bin/ggrep early in your PATH'
29+ >&2 echo ' And put /opt/homebrew/var/homebrew/linked/coreutils/libexec/gnubin early in your PATH'
30+ >&2 echo " For example: PATH=$PATH "
2731 fi
2832
29- return $error
33+ return " $error "
3034}
3135
3236main () {
3337 if is_osx; then
34- export PATH=" /usr/local/ opt/coreutils/libexec/gnubin :$PATH "
35- export PATH=" /usr/local/ opt/grep/libexec/gnubin :$PATH "
36- export PATH=" /usr/local/opt/gnu-sed /libexec/gnubin:$PATH "
38+ export PATH=" /opt/homebrew/bin/gsed :$PATH "
39+ export PATH=" /opt/homebrew/bin/ggrep :$PATH "
40+ export PATH=" /opt/homebrew/var/homebrew/linked/coreutils /libexec/gnubin:$PATH "
3741 fi
3842
3943 test_gnu_compat
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ set -euo pipefail
3+
4+ readonly script_dir=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " && pwd ) "
5+
6+ tag=" $( cat " ${script_dir} /tag" ) "
7+ version=" $( sed ' s/^v//' <<< " $tag" ) "
8+
9+ readonly source_url=" https://raw.githubusercontent.com/mclarkson/JSONPath.sh/${tag} /JSONPath.sh"
10+ readonly target_path=" $1 "
11+
12+ curl --fail -L " $source_url " -o " $target_path "
13+ chmod a+x " $target_path "
Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -30,4 +30,4 @@ output_and_cleanup() {
3030trap output_and_cleanup EXIT
3131
3232cd " $script_dir "
33- ./ensure_deps.sh ./node_modules/jsonpath.sh /JSONPath.sh " $@ " | cut -f2 | lines_to_json_array > " $tmp_stdout " 2> " $tmp_stderr "
33+ ./ensure_deps.sh ./build /JSONPath.sh " $@ " | cut -f2 | lines_to_json_array > " $tmp_stdout " 2> " $tmp_stderr "
Original file line number Diff line number Diff line change 1+ v0.0.20
You can’t perform that action at this time.
0 commit comments