0

I created a template project. When trying to create a project from that template using g8 https://github.com/....git I am getting

File: /var/folders/gy/22hljh894bdcrl35t9mz9c5h0000gp/T/giter8-22519068778300/src/main/g8/src/main/scala/$package$/service/UserRegistryActor.scala, 31:53: 'created' came as a complete surprise to me

from this piece of code

class UserRegistryActor extends Actor with ActorLogging {
  import UserRegistryActor._

  var users = Set.empty[User]

  def receive: Receive = {
    case GetUsers =>
      sender() ! Users(users.toSeq)
    case CreateUser(user) =>
      users += user
      sender() ! ActionPerformed(s"User ${user.name} created.")

    case GetUser(name) =>
      sender() ! users.find(_.name == name)
    case DeleteUser(name) =>
      users.find(_.name == name) foreach { user => users -= user }
      sender() ! ActionPerformed(s"User $name deleted.")
  }
} 

why this is happening ?

igx
  • 4,101
  • 11
  • 43
  • 88
  • 1
    try and escape `$` in your string interpolation. So something like `s"User \${user.name} created."` and `s"User \$name deleted."` Also, see https://github.com/foundweekends/giter8/issues/333 – mfirry Aug 09 '19 at 12:32
  • @mfirry thanks, unfortunately that workaround didn't help, it still shows the same error. The only solution that I found is using the separate strings with `+` sign. but your comment certainly showed me the path – igx Aug 09 '19 at 13:00

0 Answers0