Fix init when reading from stdin

This commit is contained in:
Christian Muehlhaeuser 2019-12-23 04:27:27 +01:00
parent 6ab640709c
commit f090b74c60
No known key found for this signature in database
GPG key ID: 3CF9FA45CA1EBB7E

View file

@ -122,13 +122,15 @@ func execute(cmd *cobra.Command, args []string) error {
style = "notty"
}
var baseURL string
u, err := url.ParseRequestURI(src.URL)
if err == nil {
u.Path = filepath.Dir(u.Path)
baseURL = u.String() + "/"
}
r, err := glamour.NewTermRenderer(style, ansi.Options{
BaseURL: u.String() + "/",
BaseURL: baseURL,
WordWrap: int(width),
})
if err != nil {