mirror of
https://github.com/grafana/grafana.git
synced 2024-11-23 09:26:43 -06:00
5e11af0121
* coremodel: finish string -> object datasource ref Seems we missed updating a couple of the datasource references from strings to objects. * cue fmt * Also fix dashboard in scuemata dashboard schema * Update devenv/dev-dashboards/panel-graph/graph-ng-stacking2.json Co-authored-by: Ryan McKinley <ryantxu@gmail.com> Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
17 lines
734 B
Bash
Executable File
17 lines
734 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# Strip all null values from dashboards within devenv for some particular
|
|
# schema version. Must be run from Grafana root.
|
|
|
|
# OSX users need to install GNU sed: `brew install gsed`
|
|
SED=$(command -v gsed)
|
|
SED=${SED:-"sed"}
|
|
|
|
FILES=$(grep -rl '"schemaVersion": 3[3456]' devenv)
|
|
set -e
|
|
set -x
|
|
for DASH in ${FILES}; do echo "${DASH}"; grep -v 'null,$' "${DASH}" > "${DASH}-nulless"; mv "${DASH}-nulless" "${DASH}"; done
|
|
for DASH in ${FILES}; do grep -v 'null$' "${DASH}" > "${DASH}-nulless"; mv "${DASH}-nulless" "${DASH}"; done
|
|
# shellcheck disable=SC2016,SC2002
|
|
for DASH in ${FILES}; do cat "${DASH}" | $SED -E -n 'H; x; s:,(\s*\n\s*}):\1:; P; ${x; p}' | $SED '1 d' > "${DASH}-nulless"; mv "${DASH}-nulless" "${DASH}"; done
|