MCPcopy
hub / github.com/syncthing/syncthing / runPipe

Function runPipe

build.go:1145–1165  ·  view source on GitHub ↗
(file, cmd string, args ...string)

Source from the content-addressed store, hash-verified

1143}
1144
1145func runPipe(file, cmd string, args ...string) {
1146 if debug {
1147 t0 := time.Now()
1148 log.Println("runPipe:", cmd, strings.Join(args, " "))
1149 defer func() {
1150 log.Println("... in", time.Since(t0))
1151 }()
1152 }
1153 fd, err := os.Create(file)
1154 if err != nil {
1155 log.Fatal(err)
1156 }
1157 ecmd := exec.Command(cmd, args...)
1158 ecmd.Stdout = fd
1159 ecmd.Stderr = os.Stderr
1160 err = ecmd.Run()
1161 if err != nil {
1162 log.Fatal(err)
1163 }
1164 fd.Close()
1165}
1166
1167func tarGz(out string, files []archiveFile) {
1168 fd, err := os.Create(out)

Callers 1

translateFunction · 0.85

Calls 6

FatalMethod · 0.80
NowMethod · 0.65
SinceMethod · 0.65
CreateMethod · 0.65
CloseMethod · 0.65
RunMethod · 0.45

Tested by

no test coverage detected