Skip to content

Commit

Permalink
Added a collabs setting key for adding multiple collaborators
Browse files Browse the repository at this point in the history
  • Loading branch information
thomas4g committed Sep 18, 2015
1 parent f590605 commit d264547
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ lazy val root = (project in file(".")).
settings(
name := "git-submitter-plugin",
organization := "org.cs1331",
version := "0.5-SNAPSHOT",
version := "0.6-SNAPSHOT",
sbtPlugin := true,
scalaVersion := "2.10.4",
publishMavenStyle := true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import Keys._
object GitSubmitterPlugin extends AutoPlugin {

lazy val filesToSubmit = settingKey[Seq[String]]("Tuple of files to submit")
lazy val collabs = settingKey[Seq[String]]("Tuple of users to add as collaborators")
override lazy val projectSettings = Seq(commands += submitCommand)

lazy val submitCommand = Command.command("submit") { (state: State) =>
Expand All @@ -26,10 +27,12 @@ object GitSubmitterPlugin extends AutoPlugin {
val repoName = s"${projectName}-${authenticatedUser.name}"
val submission = new StudentSubmission(authenticatedUser, repoName)
val submissionFiles = (filesToSubmit in currentRef get structure.data).get
val collabUsers = (collabs in currentRef get structure.data).get
println("Submitting files...")
submission.createRepo()
// Keys.organization should match the GitHub org name for the current semester
submission.addCollab(organization)

collabUsers.foreach(c => submission.addCollab(c))

val commitMsg = s"Solution progress at ${LocalDateTime.now}"
var pushSucceeded = true
try {
Expand Down

0 comments on commit d264547

Please sign in to comment.