import os
from posixpath import dirname
import subprocess
import sys
targetProjectPath = sys.argv[1]
tempBatFile = open("temp.bat", "w")
existDirs = [f for f in os.listdir(os.getcwd()) if os.path.isdir(f)]
for subDir in existDirs:
if os.path.exists("{}/{}".format(os.getcwd(), subDir)):
os.remove(subDir)
targetDirs = [f for f in os.listdir(targetProjectPath) if os.path.isdir("{}/{}".format(targetProjectPath, f))]
print(targetDirs)
for subDir in targetDirs:
if subDir == "obj" or subDir == "Temp" or subDir == "Logs":
continue
path = "mklink /J {} {}\{}\n".format(subDir, targetProjectPath, subDir)
tempBatFile.write(path)
tempBatFile.close()
subprocess.call([r'temp.bat'])
print("complete")