Pārlūkot izejas kodu

remove old mappings.

Lucas Stadler 11 gadi atpakaļ
vecāks
revīzija
c9ed99b834
1 mainītis faili ar 0 papildinājumiem un 17 dzēšanām
  1. 0 17
      go/qst.go

+ 0 - 17
go/qst.go

@ -8,7 +8,6 @@ import (
8 8
	"os"
9 9
	"os/exec"
10 10
	"os/signal"
11
	"path"
12 11
	"strings"
13 12
	"syscall"
14 13
	"time"
@ -29,22 +28,6 @@ qst hello.go - compiles & runs hello.go
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 31
var delay = flag.Duration("delay", 1*time.Second, "time to wait until restart")
49 32
var autoRestart = flag.Bool("autorestart", true, "automatically restart after command exists")
50 33
var command = flag.String("command", "", "command to run ({file} will be substituted)")