import os
import shutil

SOURCE_DIR = '../deploy/runtime'
TARGET_DIR = 'SAM.app/Contents/runtime'

if os.path.exists(TARGET_DIR):
    shutil.rmtree(TARGET_DIR)

shutil.copytree(SOURCE_DIR, TARGET_DIR, ignore=shutil.ignore_patterns('.git'))

SOURCE_DIR = '../deploy/solar_resource'
TARGET_DIR = 'SAM.app/Contents/solar_resource'

if os.path.exists(TARGET_DIR):
    shutil.rmtree(TARGET_DIR)

shutil.copytree(SOURCE_DIR, TARGET_DIR, ignore=shutil.ignore_patterns('.git'))

SOURCE_DIR = '../deploy/wind_resource'
TARGET_DIR = 'SAM.app/Contents/wind_resource'

if os.path.exists(TARGET_DIR):
    shutil.rmtree(TARGET_DIR)

shutil.copytree(SOURCE_DIR, TARGET_DIR, ignore=shutil.ignore_patterns('.git'))

SOURCE_DIR = '../deploy/libraries'
TARGET_DIR = 'SAM.app/Contents/libraries'

if os.path.exists(TARGET_DIR):
    shutil.rmtree(TARGET_DIR)

shutil.copytree(SOURCE_DIR, TARGET_DIR, ignore=shutil.ignore_patterns('.git'))

[((102, 128), 'os.path.exists', 'os.path.exists', (['TARGET_DIR'], {}), '(TARGET_DIR)\n', (116, 128), False, 'import os\n'), ((332, 358), 'os.path.exists', 'os.path.exists', (['TARGET_DIR'], {}), '(TARGET_DIR)\n', (346, 358), False, 'import os\n'), ((560, 586), 'os.path.exists', 'os.path.exists', (['TARGET_DIR'], {}), '(TARGET_DIR)\n', (574, 586), False, 'import os\n'), ((780, 806), 'os.path.exists', 'os.path.exists', (['TARGET_DIR'], {}), '(TARGET_DIR)\n', (794, 806), False, 'import os\n'), ((134, 159), 'shutil.rmtree', 'shutil.rmtree', (['TARGET_DIR'], {}), '(TARGET_DIR)\n', (147, 159), False, 'import shutil\n'), ((364, 389), 'shutil.rmtree', 'shutil.rmtree', (['TARGET_DIR'], {}), '(TARGET_DIR)\n', (377, 389), False, 'import shutil\n'), ((592, 617), 'shutil.rmtree', 'shutil.rmtree', (['TARGET_DIR'], {}), '(TARGET_DIR)\n', (605, 617), False, 'import shutil\n'), ((812, 837), 'shutil.rmtree', 'shutil.rmtree', (['TARGET_DIR'], {}), '(TARGET_DIR)\n', (825, 837), False, 'import shutil\n'), ((208, 238), 'shutil.ignore_patterns', 'shutil.ignore_patterns', (['""".git"""'], {}), "('.git')\n", (230, 238), False, 'import shutil\n'), ((438, 468), 'shutil.ignore_patterns', 'shutil.ignore_patterns', (['""".git"""'], {}), "('.git')\n", (460, 468), False, 'import shutil\n'), ((666, 696), 'shutil.ignore_patterns', 'shutil.ignore_patterns', (['""".git"""'], {}), "('.git')\n", (688, 696), False, 'import shutil\n'), ((886, 916), 'shutil.ignore_patterns', 'shutil.ignore_patterns', (['""".git"""'], {}), "('.git')\n", (908, 916), False, 'import shutil\n')]