Je kunt niet meer dan 25 onderwerpen selecteren
Onderwerpen moeten beginnen met een letter of nummer, kunnen streepjes bevatten ('-') en kunnen maximaal 35 tekens lang zijn.
26 regels
670 B
26 regels
670 B
package main |
|
|
|
import ( |
|
"fmt" |
|
"os" |
|
"path/filepath" |
|
) |
|
|
|
func writeLogToFile(logLines, path string) { |
|
lastPublishCommitLog, err := os.Create(filepath.Join(path, "last-commit-log.txt")) |
|
check(err) |
|
defer lastPublishCommitLog.Close() |
|
fmt.Fprintln(lastPublishCommitLog, logLines) |
|
} |
|
|
|
func writeLastCommitLog(logLines string, isBare bool, hugo *Hugo, hook *Hook) { |
|
if isBare { |
|
if hook.Publish { |
|
writeLogToFile(logLines, filepath.Join(hook.PublicHTMLPath, hugo.PublicHTMLName)) |
|
} else { |
|
writeLogToFile(logLines, filepath.Join(hook.PublicHTMLPath, hugo.PublicHTMLName, "_preview")) |
|
} |
|
} else { |
|
writeLogToFile(logLines, filepath.Join(hugo.DestinationDir)) |
|
} |
|
}
|
|
|