aboutsummaryrefslogtreecommitdiff
path: root/cmd/golangorg
diff options
context:
space:
mode:
authorCherry Mui <cherryyz@google.com>2025-02-11 12:45:51 -0500
committerCherry Mui <cherryyz@google.com>2025-02-11 10:07:48 -0800
commit83dcf2eafae84fedd44f5a38d5634ea99b4504c4 (patch)
tree45a2cbed7085cf16b60669f11f52c182b2cc2e9d /cmd/golangorg
parentd1c4fcc0c35e39c07cb9c03c13c484b2770dbe56 (diff)
downloadgo-x-website-83dcf2eafae84fedd44f5a38d5634ea99b4504c4.tar.xz
cmd/golangorg: fix local run directory path
FileInfo.Name returns the base name, not the path. Here we need the path. This makes "go run ." from cmd/golangorg directory work again. Change-Id: Iec7533758cf8a696a2696c28107caebf84bbed91 Reviewed-on: https://go-review.googlesource.com/c/website/+/648575 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Diffstat (limited to 'cmd/golangorg')
-rw-r--r--cmd/golangorg/server.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/cmd/golangorg/server.go b/cmd/golangorg/server.go
index 12008a4f..d81c18b2 100644
--- a/cmd/golangorg/server.go
+++ b/cmd/golangorg/server.go
@@ -78,9 +78,9 @@ func main() {
// which is much faster to access than the simulated file system.
if *contentDir == "" && !runningOnAppEngine {
if fi, err := os.Stat(filepath.Join("..", "..", "_content")); err == nil && fi.IsDir() {
- *contentDir = fi.Name()
+ *contentDir = filepath.Join("..", "..", "_content")
} else if fi, err := os.Stat("_content"); err == nil && fi.IsDir() {
- *contentDir = fi.Name()
+ *contentDir = "_content"
} else {
*contentDir = "" // Fall back to using embedded content.
}