#!/usr/bin/env bash

# exit on first failure
set -e

FN="platformio.ini"

if [[ $1 == "-n" ]]; then
  awk '/default_src_filter/ { sub("default_src_filter", "org_src_filter"); print "default_src_filter = +<src/*>"; } 1' $FN > $FN~ && mv $FN~ $FN
else
  git checkout $FN 2>/dev/null
fi
