···2233import (
44 "fmt"
55+ "os"
5667 "github.com/aottr/nox/internal/cache"
78 "github.com/aottr/nox/internal/config"
···4546 cacheKey := state.GenerateKey(*appName, file.Path)
46474748 // skip if file is up to date and force is not set
4848- if !ctx.Force {
4949+ if !ctx.Force && !ctx.DryRun {
4950 if prevHash, ok := st.Data[cacheKey]; ok && prevHash == hash {
5051 ctx.Logger.Printf("file %s is up to date", file.Path)
5152 continue
···6263 // skip writing file if dry run is set
6364 if ctx.DryRun {
6465 ctx.Logger.Printf("❌ dry run, not writing file %s", file.Output)
6565- fmt.Println(string(plaintext))
6666+ os.Stdout.Write(plaintext)
6667 continue
6768 }
6869 WriteToFile(plaintext, file, &FileProcessorOptions{CreateDir: true})
+2-2
internal/state/utils.go
···11package state
2233import (
44- "fmt"
54 "crypto/sha256"
65 "encoding/hex"
66+ "fmt"
77)
8899// HashContent returns the SHA256 hash of the given data.
···14141515func GenerateKey(appName, file string) string {
1616 return fmt.Sprintf("%s:%s", appName, file)
1717-}1717+}