From 0a0f35a14ec775915d5e2abc6d018f80e3517dcf Mon Sep 17 00:00:00 2001 From: Jonathan Kamens Date: Thu, 23 Aug 2012 17:25:58 -0400 Subject: [PATCH] Make ordered_pip.sh more robust Make ordered_pip.sh exit on error. Remove useless echo of empty string. Fix counting of the number of packages installed. Ignore blank lines in requirements file. --- etc/ordered_pip.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/etc/ordered_pip.sh b/etc/ordered_pip.sh index ca3fa440..3db63eb1 100755 --- a/etc/ordered_pip.sh +++ b/etc/ordered_pip.sh @@ -1,11 +1,12 @@ -#!/bin/bash +#!/bin/bash -e -echo $hash +a=0 while read line do - if [[ $line != \#* ]] ; then + if [[ -n "$line" && "$line" != \#* ]] ; then #echo $line pip install $line fi + ((a = a + 1)) done < $1 -echo "Final line count is: $a"; +echo "$0: Final package count is $a";