tmrts / boilr

:zap: boilerplate template manager that generates files or directories from template repositories
Apache License 2.0
1.73k stars 119 forks source link

Panic on trying to template images [JPG] #68

Open HaoZeke opened 6 years ago

HaoZeke commented 6 years ago

Reproduction

Folder structure:

.
├── project.json
├── template
|   ├── img
|         └── ksenia-makagonova-229007.jpg

Commands:

boilr template download HaoZeke/boilr-docuYoda boilr-docuYoda
boilr template use boilr-docuYoda test

The above is actually found at this commit .

Errors

The following is obtained:

[✔] Created .babelrc
[✔] Created .gitignore
[?] Please choose a value for "License" [default: "MIT"]: 
[?] Please choose a value for "Year" [default: "2018"]: 
[?] Please choose a value for "Author" [default: "Rohit Goswami"]: 
[?] Please choose a value for "Email" [default: "HaoZeke[at]yandex.com"]: 
[✔] Created LICENSE.md
[?] Please choose a value for "DocumentName" [default: "docuYoda"]: 
[?] Please choose a value for "PayPalMeID" [default: "HaoZeke"]: 
[?] Please choose a value for "SemaUserName" [default: "haozeke"]: 
[?] Please choose a value for "GithubUserName" [default: "HaoZeke"]: 
[?] Please choose a value for "RepoName" [default: "boilr-docuYoda"]: 
[✔] Created README.md
[✔] Created gulpfile.babel.js
[✔] Created package.json
[✔] Created scripts/TeXLive.sh
[?] Please choose a value for "GithubEmail" [default: "HaoZeke@yandex.com"]: 
[✔] Created scripts/deploy.sh
[✔] Created scripts/firaFonts.sh
[✔] Created scripts/getPandoc.sh
[✔] Created scripts/semaphoreBuilder
[✔] Created scripts/texlive.profile
[✔] Created src/conf/.latexmkrc
[?] Please choose a value for "SubTitle" [default: "Pandoc documents for Turtles."]: 
[?] Please choose a value for "Date" [default: "14-02-18"]: 
[?] Please choose a value for "Subject" [default: "docuYoda"]: 
[✔] Created src/conf/commonConf.yml
[?] Please choose a value for "DocumentClass" [default: "scrbook"]: 
[✔] Created src/conf/texConf.yml
[✔] Created src/filters/panfHeaderList.py
[✔] Created src/filters/panfluteInc.py
panic: template: ksenia-makagonova-229007.jpg:36: unexpected bad character U+FFFD '�' in command

goroutine 1 [running]:
text/template.Must(0x0, 0xc7e300, 0xc420050310, 0x1)
    /usr/lib/go/src/text/template/helper.go:23 +0x54
github.com/tmrts/boilr/pkg/template.(*dirTemplate).Execute.func2(0xc420024930, 0x62, 0xc88940, 0xc420319110, 0x0, 0x0, 0x0, 0x0)
    /home/haozeke/src/github.com/tmrts/boilr/pkg/template/template.go:236 +0x65d
path/filepath.walk(0xc420024930, 0x62, 0xc88940, 0xc420319110, 0xc42015cbd0, 0x0, 0x0)
    /usr/lib/go/src/path/filepath/path.go:356 +0x81
path/filepath.walk(0xc420021590, 0x45, 0xc88940, 0xc420318ea0, 0xc42015cbd0, 0x0, 0x0)
    /usr/lib/go/src/path/filepath/path.go:381 +0x3a0
path/filepath.walk(0xc4200212c0, 0x41, 0xc88940, 0xc4202ba680, 0xc42015cbd0, 0x0, 0x0)
    /usr/lib/go/src/path/filepath/path.go:381 +0x3a0
path/filepath.walk(0xc42001f100, 0x3d, 0xc88940, 0xc42015f110, 0xc42015cbd0, 0x0, 0x30)
    /usr/lib/go/src/path/filepath/path.go:381 +0x3a0
path/filepath.Walk(0xc42001f100, 0x3d, 0xc42015cbd0, 0x8a15ff, 0xc4200c79c0)
    /usr/lib/go/src/path/filepath/path.go:403 +0x11d
github.com/tmrts/boilr/pkg/template.(*dirTemplate).Execute(0xc420186850, 0xc4201689c0, 0x20, 0x20, 0xc4201689c0)
    /home/haozeke/src/github.com/tmrts/boilr/pkg/template/template.go:172 +0xb9
github.com/tmrts/boilr/pkg/cmd.glob..func8.1(0x0, 0x0)
    /home/haozeke/src/github.com/tmrts/boilr/pkg/cmd/use.go:89 +0x15f
github.com/tmrts/boilr/pkg/cmd.glob..func8(0xcd3900, 0xc420157e40, 0x2, 0x2)
    /home/haozeke/src/github.com/tmrts/boilr/pkg/cmd/use.go:97 +0x479
github.com/spf13/cobra.(*Command).execute(0xcd3900, 0xc420157d80, 0x2, 0x2, 0xcd3900, 0xc420157d80)
    /home/haozeke/src/github.com/spf13/cobra/command.go:757 +0x2c1
github.com/spf13/cobra.(*Command).ExecuteC(0xcd2600, 0x9e012e, 0x2f, 0xc4200c7ec0)
    /home/haozeke/src/github.com/spf13/cobra/command.go:843 +0x334
github.com/spf13/cobra.(*Command).Execute(0xcd2600, 0xc4200c7ec0, 0x1)
    /home/haozeke/src/github.com/spf13/cobra/command.go:791 +0x2b
github.com/tmrts/boilr/pkg/cmd.Run()
    /home/haozeke/src/github.com/tmrts/boilr/pkg/cmd/root.go:52 +0x6b4
main.main()
    /home/haozeke/src/github.com/tmrts/boilr/boilr.go:20 +0xcd

Expected

No such error is expected.

System Details

Neofetch output

$ boilr version
[i] Current version is 0.3.0