Lucas Stadler лет назад: 11
Родитель
Сommit
c9ed99b834
1 измененных файлов с 0 добавлено и 17 удалено
  1. 0 17
      go/qst.go

+ 0 - 17
go/qst.go

8
	"os"
8
	"os"
9
	"os/exec"
9
	"os/exec"
10
	"os/signal"
10
	"os/signal"
11
	"path"
12
	"strings"
11
	"strings"
13
	"syscall"
12
	"syscall"
14
	"time"
13
	"time"
29
28
30
*/
29
*/
31
30
32
var mappings = map[string]func(string) string{
33
	".go": func(name string) string {
34
		outpath := strings.TrimSuffix(name, path.Ext(name))
35
		if !path.IsAbs(outpath) {
36
			outpath = fmt.Sprintf("./%s", outpath)
37
		}
38
		return fmt.Sprintf("go build -o %s %s && %s", outpath, name, outpath)
39
	},
40
	".rb": func(name string) string {
41
		return fmt.Sprintf("ruby %s", name)
42
	},
43
	".py": func(name string) string {
44
		return fmt.Sprintf("python %s", name)
45
	},
46
}
47
48
var delay = flag.Duration("delay", 1*time.Second, "time to wait until restart")
31
var delay = flag.Duration("delay", 1*time.Second, "time to wait until restart")
49
var autoRestart = flag.Bool("autorestart", true, "automatically restart after command exists")
32
var autoRestart = flag.Bool("autorestart", true, "automatically restart after command exists")
50
var command = flag.String("command", "", "command to run ({file} will be substituted)")
33
var command = flag.String("command", "", "command to run ({file} will be substituted)")