@@ -0,0 +1,45 @@
8+ "github.com/replit/prybar/utils"
12+func Execute(config *utils.Config) {
13+ path, err := exec.LookPath("scala")
20+ args := []string{"scala"}
23+ args = append(args, "-Dscala.shell.welcome=")
26+ if config.Code != "" {
27+ args = append(args, "-e", config.Code)
30+ if config.Exp != "" {
31+ printStatement := fmt.Sprintf("print(%s)", config.Exp)
32+ args = append(args, "-e", printStatement)
35+ if config.Ps1 != "" {
36+ args = append(args, "-Dscala.shell.prompt=%n" + config.Ps1)
39+ if config.Args != nil && len(config.Args) > 0 {
40+ args = append(args, "-i")
41+ args = append(args, config.Args...)
44+ syscall.Exec(path, args, env)