set course directory in from course archive action
authorEkaterina Tuzova <Ekaterina.Tuzova@jetbrains.com>
Wed, 3 Aug 2016 10:43:51 +0000 (13:43 +0300)
committerEkaterina Tuzova <Ekaterina.Tuzova@jetbrains.com>
Wed, 3 Aug 2016 10:43:51 +0000 (13:43 +0300)
python/educational-core/course-creator/src/com/jetbrains/edu/coursecreator/actions/CCFromCourseArchive.java

index 88ad4c3fdf8df6b2239eb14fdc651083ad0d2b9d..bbee0d9610ab8c749690e5d31301408a36115d6d 100644 (file)
@@ -34,6 +34,8 @@ import java.io.*;
 import java.util.ArrayList;
 import java.util.Map;
 
+import static com.jetbrains.edu.learning.courseGeneration.StudyProjectGenerator.OUR_COURSES_DIR;
+
 public class CCFromCourseArchive extends DumbAwareAction {
   private static final Logger LOG = Logger.getInstance(CCFromCourseArchive.class.getName());
 
@@ -76,6 +78,8 @@ public class CCFromCourseArchive extends DumbAwareAction {
       }
 
       StudyTaskManager.getInstance(project).setCourse(course);
+      File courseDir = new File(OUR_COURSES_DIR, course.getName() + "-" + project.getName());
+      course.setCourseDirectory(courseDir.getPath());
       course.setCourseMode(CCUtils.COURSE_MODE);
       project.getBaseDir().refresh(false, true);
       int index = 1;