1
0
mirror of git://projects.qi-hardware.com/eda-tools.git synced 2024-11-26 00:17:11 +02:00

gitsch2ps: added option -k to keep temporary clone of repository

- schhist/gitsch2ps: new option -k to keep the cloned repository and print
  the path name of the temporary directory on standard output
- schhist/gitsch2ps: invoked "git clone" with -q to suppress progress
  output on standard output
This commit is contained in:
Werner Almesberger 2010-09-22 06:57:36 -03:00
parent 553514cc67
commit 150f9ab4d4

View File

@ -17,6 +17,7 @@ usage()
cat <<EOF 1>&2
usage: $0 [options] top-dir top-schem [commit] outdir
-k keep the temporary directory and print its name
-S sanitize the KiCad profile
EOF
exit 1
@ -24,8 +25,11 @@ EOF
sanitize=true
keep=false
while true; do
case "$1" in
-k) keep=true
shift;;
-S) sanitize=`PATH="$PATH":\`dirname "$0"\` which sanitize-profile`
[ "$sanitize" = "${sanitize#/}" ] && sanitize=`pwd`/"$sanitize"
shift;;
@ -59,7 +63,7 @@ sch="$tmp/$sdir"
rm -rf "$tmp"
rm -rf "$outdir"
git clone -s -n "$dir/.git" "$tmp" || exit
git clone -q -s -n "$dir/.git" "$tmp" || exit
( cd "$tmp" && git checkout -q "$commit"; ) || exit
if [ ! -f "$tmp/$schem" ]; then
@ -78,4 +82,8 @@ fi
mkdir -p "$outdir"
mv "$sch"/*.ps "$outdir"
rm -rf "$tmp"
if $keep; then
echo "$tmp"
else
rm -rf "$tmp"
fi