Skip to content

Commit

Permalink
🐝 (svg tester) format reference svgs
Browse files Browse the repository at this point in the history
  • Loading branch information
sophiamersmann committed Jan 9, 2025
1 parent ea5361d commit 8a2a611
Showing 1 changed file with 37 additions and 15 deletions.
52 changes: 37 additions & 15 deletions devTools/svgTester/update-configs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,29 +20,51 @@ Make sure to run \`make refresh\` and \`make refresh.pageviews\` before running

main() {
echo "=> Resetting owid-grapher-svgs to origin/master"
cd $SVGS_REPO\
&& git fetch\
&& git checkout -f master\
&& git reset --hard origin/master\
&& git clean -fd\
cd $SVGS_REPO \
&& git fetch \
&& git checkout -f master \
&& git reset --hard origin/master \
&& git clean -fdx \
&& cd -

echo "=> Removing existing configs and reference svgs"
rm -rf $CONFIGS_DIR $REFERENCES_DIR $ALL_VIEWS_DIR

echo "=> Dumping new configs and data"
rm -rf $CONFIGS_DIR
node itsJustJavascript/devTools/svgTester/dump-data.js -o $CONFIGS_DIR
node itsJustJavascript/devTools/svgTester/dump-chart-ids.js -o $CHART_IDS_FILE

echo "=> Generating reference SVGs"
node itsJustJavascript/devTools/svgTester/export-graphs.js\
-i $CONFIGS_DIR\
echo "=> Committing new configs and chart ids"
cd $SVGS_REPO \
&& git add --all \
&& git commit -m "chore: update configs and chart ids" \
&& cd -

echo "=> Generating reference SVGs (default views)"
rm -rf $REFERENCES_DIR
node itsJustJavascript/devTools/svgTester/export-graphs.js \
-i $CONFIGS_DIR \
-o $REFERENCES_DIR
node itsJustJavascript/devTools/svgTester/export-graphs.js\
-i $CONFIGS_DIR\
-o $ALL_VIEWS_SVG_DIR\
-f $CHART_IDS_FILE\
yarn prettier --write --parser html $REFERENCES_DIR

echo "=> Committing reference SVGs (default views)"
cd $SVGS_REPO \
&& git add --all \
&& git commit -m 'chore: update reference svgs (default views)' \
&& cd -

echo "=> Generating reference SVGs (all views)"
rm -rf $ALL_VIEWS_DIR
node itsJustJavascript/devTools/svgTester/export-graphs.js \
-i $CONFIGS_DIR \
-o $ALL_VIEWS_SVG_DIR \
-f $CHART_IDS_FILE \
--all-views
yarn prettier --write --parser html $ALL_VIEWS_SVG_DIR

echo "=> Committing reference SVGs (all views)"
cd $SVGS_REPO \
&& git add --all \
&& git commit -m 'chore: update reference svgs (all views)' \
&& cd -
}

# show help
Expand Down

0 comments on commit 8a2a611

Please sign in to comment.