Footprint library install script improvements.

* Make WORKING_TREES configurable with an environment variable to simplify
  external install scripts.
* Use native sed functionality rather than grep to find relevant lines in
  github JSON (grep can create trouble if there is a global --color=always
  setting, guess how I found out about the color setting)
This commit is contained in:
Henner Zeller 2015-08-05 11:01:16 -04:00 committed by Wayne Stambaugh
parent aaadb40a71
commit ecb046ad0e
1 changed files with 3 additions and 4 deletions

View File

@ -24,7 +24,7 @@
# Set where the library repos will go, use a full path # Set where the library repos will go, use a full path
WORKING_TREES=~/kicad_sources WORKING_TREES=${WORKING_TREES:-~/kicad_sources}
usage() usage()
@ -122,10 +122,9 @@ detect_pretty_repos()
fi fi
# Use github API to list repos for org KiCad, then subset the JSON reply for only # Use github API to list repos for org KiCad, then subset the JSON reply for only
# *.pretty repos # *.pretty repos in the "full_name" variable.
PRETTY_REPOS=`curl https://api.github.com/orgs/KiCad/repos?per_page=2000 2> /dev/null \ PRETTY_REPOS=`curl https://api.github.com/orgs/KiCad/repos?per_page=2000 2> /dev/null \
| grep full_name | grep pretty \ | sed $SED_EREGEXP 's:.+ "full_name".*"KiCad/(.+\.pretty)",:\1:p;d'`
| sed $SED_EREGEXP 's:.+ "KiCad/(.+)",:\1:'`
#echo "PRETTY_REPOS:$PRETTY_REPOS" #echo "PRETTY_REPOS:$PRETTY_REPOS"