import shutil, os, sys

#TODO maybe use sys.argv, add in css & JS compress like template package.py

#Directory to copy to:
WPPLUGINS = 'C:\\xampp\\htdocs\\wordpress\\wp-content\\plugins'

plugins = ['com.sharefaith.churchapp']

def copyPlugins(plugins):
	for folder in plugins:
		
		if os.path.exists(os.path.join('wordpress/plugins/', folder)):
			#re-copy:
			dest = os.path.join(WPPLUGINS, folder)
			if os.path.exists( dest ):
				shutil.rmtree( dest )
				
			shutil.copytree( os.path.join('wordpress/plugins/', folder), dest )
			print 'Copied! Enjoy the plugin!'
		else:
			print 'nonexistent?'

while True:
	copyPlugins(plugins)
	print 'Again?'
	raw_input() #wait for enter
