Skip to content

Commit

Permalink
Fix alternate robot.
Browse files Browse the repository at this point in the history
  • Loading branch information
pietroglyph committed Nov 23, 2018
1 parent 37409ad commit 5e449d8
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
1 change: 1 addition & 0 deletions deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ func (t *DeployTarget) RunCurrentJob() error {
if err != nil {
return err
}

className = alternateDirectoryName + "." + strings.TrimSuffix(alternateRobotFileName, config.LessonFileSuffix)
}

Expand Down
3 changes: 1 addition & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 1 addition & 3 deletions users.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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
}

Expand Down

0 comments on commit 5e449d8

Please sign in to comment.