avoid resolving dependencies twice for the same plugin

Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
diff --git a/install-plugins.sh b/install-plugins.sh
index c4be58a..8430539 100755
--- a/install-plugins.sh
+++ b/install-plugins.sh
@@ -17,7 +17,10 @@
 	else
 		echo "$plugin is already downloaded."
 	fi	
-	resolveDependencies $1
+
+	if [[ ! -f ${plugin}.resolved ]]; then
+		resolveDependencies $1
+	fi
 }
 
 function resolveDependencies() {	
@@ -50,6 +53,7 @@
     		download $plugin
 		fi
 	done
+	touch ${plugin}.resolved
 }
 
 
@@ -58,3 +62,6 @@
 do
     download $plugin
 done
+
+# cleanup 'resolved' flag files
+rm *.resolved