mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-31 22:41:53 +02:00
@@ -6,6 +6,7 @@ package testenv
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"os"
|
||||
"os/exec"
|
||||
@@ -60,6 +61,13 @@ func tryExec() error {
|
||||
// may as well use the same path so that this branch can be tested without
|
||||
// an ios environment.
|
||||
|
||||
if !testing.Testing() {
|
||||
// This isn't a standard 'go test' binary, so we don't know how to
|
||||
// self-exec in a way that should succeed without side effects.
|
||||
// Just forget it.
|
||||
return errors.New("can't probe for exec support with a non-test executable")
|
||||
}
|
||||
|
||||
// We know that this is a test executable. We should be able to run it with a
|
||||
// no-op flag to check for overall exec support.
|
||||
exe, err := os.Executable()
|
||||
|
Reference in New Issue
Block a user