#!/bin/sh

if [ ! -f main.c ]; then
  echo "no main.c available"
  exit 1
fi
if [ -f main.c-bak ]; then
  echo "main.c-bak already available, delete manually"
  exit 1
fi

/opt/CubeMXImporter/cubemximporter.py  ../ ../cubemx/car/
mv main.c main.c-bak
cat main.c-bak | ../tools/insertMyCode.pl > main.c

