Skip to content

Commit a4e74bd

Browse files
committed
fix
1 parent f7c9b37 commit a4e74bd

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

modules/setting/setting.go

+5-2
Original file line numberDiff line numberDiff line change
@@ -113,16 +113,19 @@ func getWorkPath(appPath string) string {
113113

114114
func init() {
115115
IsWindows = runtime.GOOS == "windows"
116+
if AppVer == "" {
117+
AppVer = "dev"
118+
}
119+
116120
// We can rely on log.CanColorStdout being set properly because modules/log/console_windows.go comes before modules/setting/setting.go lexicographically
117-
// By default set this logger at Info - we'll change it later but we need to start with something.
121+
// By default set this logger at Info - we'll change it later, but we need to start with something.
118122
log.NewLogger(0, "console", "console", fmt.Sprintf(`{"level": "info", "colorize": %t, "stacktraceLevel": "none"}`, log.CanColorStdout))
119123

120124
var err error
121125
if AppPath, err = getAppPath(); err != nil {
122126
log.Fatal("Failed to get app path: %v", err)
123127
}
124128
AppWorkPath = getWorkPath(AppPath)
125-
AppVer = "dev"
126129
}
127130

128131
func forcePathSeparator(path string) {

routers/web/repo/view.go

+3
Original file line numberDiff line numberDiff line change
@@ -930,6 +930,9 @@ func renderCode(ctx *context.Context) {
930930
}
931931

932932
checkCitationFile(ctx, entry)
933+
if ctx.Written() {
934+
return
935+
}
933936

934937
renderLanguageStats(ctx)
935938
if ctx.Written() {

0 commit comments

Comments
 (0)