mirror of
https://github.com/golang/go.git
synced 2025-05-05 15:43:04 +00:00
go.tools/playground: return a better message for code starting with a shebang on non local mode
LGTM=adg, dan.kortschak R=adg, dan.kortschak, campoy CC=golang-codereviews https://golang.org/cl/119160043
This commit is contained in:
parent
149e030318
commit
cf8082eec5
@ -176,8 +176,12 @@ func startProcess(id, body string, out chan<- *Message, opt *Options) *process {
|
|||||||
done: make(chan struct{}),
|
done: make(chan struct{}),
|
||||||
}
|
}
|
||||||
var err error
|
var err error
|
||||||
if path, args := shebang(body); RunScripts && path != "" {
|
if path, args := shebang(body); path != "" {
|
||||||
err = p.startProcess(path, args, body)
|
if RunScripts {
|
||||||
|
err = p.startProcess(path, args, body)
|
||||||
|
} else {
|
||||||
|
err = errors.New("script execution is not allowed")
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
err = p.start(body, opt)
|
err = p.start(body, opt)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user