[PATCH] cg-add checks to see if file exists
- From
- Rhys Hardwick <rhys@rhyshardwick.co.uk>
- Date
- Apr 26, 2005, 22:17 UTC
- Message-ID
- <200504262317.49739.rhys@rhyshardwick.co.uk>
Hi,
This is a patch to check if the file being added exists, and if not, issues a warning and dies.
Rhys
Signed-off-by: Rhys Hardwick <rhys@rhyshardwick.co.uk
Index: cg-add =================================================================== --- 6159f313b10f0cfcdfedd63d6fb044029fe46aaa/cg-add (mode:100755 sha1:8ba5351a4c7e28a577ea1aa4afa1078c54e9bccc) +++ uncommitted/cg-add (mode:100755) @@ -10,4 +10,10 @@ [ "$1" ] || die "usage: cg-add FILE..." +if [ -f "$1" ]; then + echo "Adding file $1" +else + die "$1 does not exist" +fi + update-cache --add -- "$@"