added osutils.IsProbablyGoRun

This commit is contained in:
Gani Georgiev
2025-09-06 18:14:20 +03:00
parent a088cf6379
commit 40f2ba731c
6 changed files with 60 additions and 8 deletions
+2 -3
View File
@@ -5,7 +5,6 @@ import (
"net/http"
"os"
"path/filepath"
"strings"
"github.com/pocketbase/pocketbase"
"github.com/pocketbase/pocketbase/apis"
@@ -14,6 +13,7 @@ import (
"github.com/pocketbase/pocketbase/plugins/jsvm"
"github.com/pocketbase/pocketbase/plugins/migratecmd"
"github.com/pocketbase/pocketbase/tools/hook"
"github.com/pocketbase/pocketbase/tools/osutils"
)
func main() {
@@ -123,8 +123,7 @@ func main() {
// the default pb_public dir location is relative to the executable
func defaultPublicDir() string {
if strings.HasPrefix(os.Args[0], os.TempDir()) {
// most likely ran with go run
if osutils.IsProbablyGoRun() {
return "./pb_public"
}