Skip to content

Commit 4ad8f87

Browse files
committed
Update gridlabd-marimo
1 parent fe2f362 commit 4ad8f87

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

subcommands/gridlabd-marimo

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@
2828
## GridLAB-D marimo notebooks are distributed from the GitHub arras-energy
2929
## repository `marimo`.
3030
##
31+
## Caveats:
32+
##
33+
## * Master branches only return the "official" index published in
34+
## `source/.index`. All other branches return a list of all Python files in
35+
## `source/`.
36+
##
3137
## See also:
3238
##
3339
## * https://github.com/arras-energy/marimo
@@ -70,7 +76,11 @@ function index()
7076
#
7177
# Display a list of available notebooks online
7278
#
73-
curl -sL -H 'Cache-Control: no-cache' $URL/.index 2>>$LOG
79+
if [ "$(gridlabd.bin --version=branch)" == "master" ]; then
80+
curl -sL -H 'Cache-Control: no-cache' $URL/.index 2>>$LOG
81+
else
82+
curl -L https://api.github.com/repos/arras-energy/marimo/contents/source 2>>$LOG | grep '"name": ".*\.py",' /tmp/index.json | cut -f2 -d: | cut -f1 -d. | tr -cd "A-Za-z0-9_\\n"
83+
fi
7484
}
7585

7686
function getlist()

0 commit comments

Comments
 (0)