Skip to content

Commit

Permalink
Fix .gitignore filename when generating defaults.
Browse files Browse the repository at this point in the history
  • Loading branch information
jimafisk committed Jul 31, 2020
1 parent 0d52248 commit 967b49e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 1 addition & 2 deletions generated/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ package generated

// Defaults: scaffolding used in 'build' command
var Defaults = map[string][]byte{
"/.gitignore": []byte(`public
node_modules`),
"/.gitignore": []byte(``),
"/assets/favicon.svg": []byte(`<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg width="47.596mm" height="47.596mm" version="1.1" viewBox="0 0 47.596 47.596" xmlns="http://www.w3.org/2000/svg" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
Expand Down
3 changes: 3 additions & 0 deletions generators/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ func generate(name string) {
return err
}
if !info.IsDir() {
if strings.HasSuffix(path, "_") {
path = strings.TrimSuffix(path, "_")
}
out.Write([]byte("\t\"" + strings.TrimPrefix(path, name) + "\": []byte(`"))
content, _ := ioutil.ReadFile(path)
// Escape the backticks that would break string literals
Expand Down

0 comments on commit 967b49e

Please sign in to comment.