diff --git a/deploy.go b/deploy.go index 1df438e..4405bce 100644 --- a/deploy.go +++ b/deploy.go @@ -127,6 +127,7 @@ func (t *DeployTarget) RunCurrentJob() error { if err != nil { return err } + className = alternateDirectoryName + "." + strings.TrimSuffix(alternateRobotFileName, config.LessonFileSuffix) } diff --git a/main.go b/main.go index 827e2e4..7e87666 100644 --- a/main.go +++ b/main.go @@ -163,11 +163,10 @@ func loadStockLessons() { lesson.Modified = false if lessonInfo.AlternateRobotPath != "" { - lessonInfo.AlternateRobotPath, err = filepath.Abs(lessonInfo.AlternateRobotPath) + lesson.AlternateRobotPath, err = filepath.Abs(filepath.Join(filepath.Dir(config.LessonConfigPath), lessonInfo.AlternateRobotPath)) if err != nil { log.Panicln(err) } - lesson.AlternateRobotPath = lessonInfo.AlternateRobotPath } _, fileName := filepath.Split(lesson.Path) diff --git a/users.go b/users.go index 6445328..c5f0722 100644 --- a/users.go +++ b/users.go @@ -118,7 +118,7 @@ func (u *User) LessonSlice() ([]*Lesson, error) { return u.lessons.Slice(), nil } -// lessons gets all the user's Lessons -- modified or not. +// updateLessons loads all of the lessons modified by the user into the user's lessons array func (u *User) updateLessons() error { // Server must be restarted to read new lessons if len(u.lessons) > 0 { @@ -161,8 +161,6 @@ func (u *User) updateLessons() error { u.lessons[fileName] = lesson } - // We return a copy of u.lessons, so we don't worry about data races on map access, - // just data races on the underlying *Lesson. return nil }