Skip to content

Commit

Permalink
Merge pull request #107 from x-motemen/stdout-files
Browse files Browse the repository at this point in the history
output updated files to stdout
  • Loading branch information
Songmu authored Oct 21, 2023
2 parents 103a5b0 + 941e090 commit 5fe10ba
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions broker.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package main

import (
"fmt"
"io"
"net/http"
"os"
"path/filepath"
Expand All @@ -14,6 +15,7 @@ import (
type broker struct {
*atom.Client
*blogConfig
writer io.Writer
}

func newBroker(bc *blogConfig) *broker {
Expand All @@ -27,6 +29,7 @@ func newBroker(bc *blogConfig) *broker {
},
},
blogConfig: bc,
writer: os.Stdout,
}
}

Expand Down Expand Up @@ -109,6 +112,7 @@ func (b *broker) Store(e *entry, path, origPath string) error {
if err := os.WriteFile(path, []byte(e.fullContent()), 0666); err != nil {
return err
}
fmt.Fprintln(b.writer, path)

if err := os.Chtimes(path, *e.LastModified, *e.LastModified); err != nil {
return err
Expand Down

0 comments on commit 5fe10ba

Please sign in to comment.