Add nodl flag

This commit is contained in:
2025-03-26 21:08:50 +01:00
parent 5945f8cc25
commit de1b68af25

View File

@@ -34,6 +34,7 @@ func init() {
const remoteUrl = "https://git.site.quack-lab.dev/dave/barotrauma-gamefiles/raw/branch/cooked/Content" const remoteUrl = "https://git.site.quack-lab.dev/dave/barotrauma-gamefiles/raw/branch/cooked/Content"
func main() { func main() {
nodl := flag.Bool("nodl", false, "nodl")
hashfile := flag.String("hashfile", "hashes.txt", "hashfile") hashfile := flag.String("hashfile", "hashes.txt", "hashfile")
flag.Parse() flag.Parse()
@@ -126,6 +127,11 @@ func main() {
file = strings.ReplaceAll(file, "\\", "/") file = strings.ReplaceAll(file, "\\", "/")
path := filepath.Join(root, file) path := filepath.Join(root, file)
log.Printf("Downloading %s", file) log.Printf("Downloading %s", file)
if *nodl {
log.Printf("Skipping download for %s", file)
hashes.Store(file, remoteHash)
return
}
err := UpdateLocalFile(path, remoteUrl+"/"+file) err := UpdateLocalFile(path, remoteUrl+"/"+file)
if err != nil { if err != nil {
Error.Printf("error updating local file: %v", err) Error.Printf("error updating local file: %v", err)