diff --git a/kicad-git-setup b/kicad-git-setup index 70064455d793d032cb436e55349b902c3626d911..979805f9dcdfaf1b46569efd46eb3e6986116752 100755 --- a/kicad-git-setup +++ b/kicad-git-setup @@ -33,6 +33,13 @@ if [ ${#SCHEMATICS[*]} -eq 0 ] ; then exit 1 fi +PROJECT=( *.pro ) +if [ ${#PROJECT[*]} -ne 1 ] ; then + echo "Not the expected number of projects (${#PROJECT[*]} != 1)" >&2 + echo " ${PROJECT[*]}" >&2 + exit 1 +fi + if [ ! -d .git ] ; then # Initialize git git init @@ -41,11 +48,11 @@ fi # Fill in .gitignore GITIGNORE=( "*~" "*.net" "*.kicad_pcb-bak" "*.bak" "_autosave*" ) GITIGNORE+=( "*.csv" "*.tsv" "*.xml" ) -for s in ${SCHEMATICS[@]} ; do - if [[ "$s" =~(.*)\.sch ]] ; then +for s in ${PROJECT[@]} ; do + if [[ "$s" =~ (.*)\.pro ]] ; then BASE=${BASH_REMATCH[1]} # Autoroute files - GITIGNORE+=( ${BASE}.bin ${BASE}.dsn ${BASE}.ses ) + # GITIGNORE+=( ${BASE}.bin ${BASE}.dsn ${BASE}.ses ) # Other stuff GITIGNORE+=( ${BASE}-rescue.lib ) fi