Skip to content
This repository was archived by the owner on Jun 3, 2025. It is now read-only.

Commit 88e1b69

Browse files
author
mikkomaa
committed
Merge pull request #192 from tmc-cli/fixing-matike
Fixing matike
2 parents 610d518 + a756db2 commit 88e1b69

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

src/main/java/fi/helsinki/cs/tmc/cli/command/ListExercisesCommand.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public void run(String[] args, Io io) {
4040
courseName = courseinfo.getCourseName();
4141

4242
} else {
43-
this.io.println("USAGE: tmc exercise COURSE");
43+
this.io.println("USAGE: tmc list-exercises COURSE");
4444
this.io.println("No course specified. Either run the command "
4545
+ "inside a course directory or enter\n"
4646
+ "the course as a parameter.");

src/main/java/fi/helsinki/cs/tmc/cli/command/UpdateCommand.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import fi.helsinki.cs.tmc.core.domain.Course;
1515
import fi.helsinki.cs.tmc.core.domain.Exercise;
1616

17+
import java.nio.file.Path;
1718
import java.util.List;
1819

1920
@Command(name = "update", desc = "Update exercises")
@@ -39,7 +40,14 @@ public void run(String[] args, Io io) {
3940
if (core == null) {
4041
return;
4142
}
43+
4244
DirectoryUtil dirUtil = new DirectoryUtil();
45+
46+
if (dirUtil.getCourseDirectory() == null) {
47+
io.println("Not a course directory");
48+
return;
49+
}
50+
4351
CourseInfo info = CourseInfoIo.load(dirUtil.getConfigFile());
4452
Course course = info.getCourse();
4553
List<Exercise> exercises;
@@ -60,5 +68,7 @@ public void run(String[] args, Io io) {
6068
for (Exercise exercise : exercises) {
6169
io.println(exercise.getName());
6270
}
71+
72+
System.out.println(TmcUtil.downloadExercises(core, exercises));
6373
}
6474
}

0 commit comments

Comments
 (0)