Don't check for existence of source file/dir as find return only existing ones.
authorOleksandr Gavenko <gavenkoa@gmail.com>
Wed, 12 May 2010 14:26:16 +0300
changeset 77 46f5f10ec084
parent 76 85dc8b07017a
child 78 c014474497f0
Don't check for existence of source file/dir as find return only existing ones.
Makefile
--- a/Makefile	Wed May 12 14:19:12 2010 +0300
+++ b/Makefile	Wed May 12 14:26:16 2010 +0300
@@ -24,11 +24,10 @@
 		if [ -d $$item ]; then \
 			for file in `find $$item`; do \
 				if [ -d $$file ]; then \
-					[ -d $(HOME)/$$file ] || mkdir -p $(HOME)/$$file; \
+					mkdir -p $(HOME)/$$file; \
+					continue; \
 				fi; \
-				if [ -f $$file ]; then \
-					install -m 640 $$file $(HOME)/$$file; \
-				fi; \
+				install -m 640 $$file $(HOME)/$$file; \
 			done; \
 		fi; \
 	done
@@ -39,9 +38,10 @@
 		if [ -d $$item ]; then \
 			for file in `find $$item`; do \
 				if [ -d $$file ]; then \
-					[ -d $(HOME)/$$file ] || mkdir -p $(HOME)/$$file; \
+					mkdir -p $(HOME)/$$file; \
+					continue; \
 				fi; \
-				if [ -f $$file -a ! -f $(HOME)/$$file ]; then \
+				if [ ! -f $(HOME)/$$file ]; then \
 					install -m 640 $$file $(HOME)/$$file; \
 				fi; \
 			done; \