Skip to content

Commit

Permalink
Merge pull request #125 from ks156/next
Browse files Browse the repository at this point in the history
Fixed a bug with the duplication from sd to flash
  • Loading branch information
drasko committed Feb 2, 2015
2 parents c43ff5a + e3d3394 commit 6804827
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions handlers/dashboardHandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
###


import os, signal, sys, platform, subprocess, datetime
import os, signal, sys, platform, subprocess, datetime, shutil
from os.path import isfile, join

from tornado import web, ioloop, iostream, gen
Expand Down Expand Up @@ -325,7 +325,10 @@ def duplicateProject(self, rq):
if (len(path)>0):
if (storage != "sd" and storage != "usbFlash"):
# Destroy symlink
os.remove(config["last_opened_project"]+"/www")
if os.path.islink(config["last_opened_project"]+"/www"):
os.remove(config["last_opened_project"]+"/www")
else:
shutil.rmtree(config["last_opened_project"]+"/www")
# copy all files
try:
copytree(config["last_opened_project"], path)
Expand All @@ -340,7 +343,7 @@ def duplicateProject(self, rq):

if (storage != "sd" and storage != "usbFlash"):
# Recreate symlink
os.symlink(config["absolut_root_path"] + "/www/", config["last_opened_project"] + "/www")
os.symlink(config["absolut_root_path"] + "/www/", path + "/www")
else:
if not (os.path.exists(path + "/www")):
copytree(config["absolut_root_path"] + "/www/", path + "/www", ignore=ignore_patterns('sd', 'flash', 'examples', 'usbFlash'))
Expand Down

0 comments on commit 6804827

Please sign in to comment.