mirror of
https://github.com/charmbracelet/glow
synced 2024-12-14 14:12:27 +00:00
Fix baseURL for relative paths
This commit is contained in:
parent
ee81103ce0
commit
584adfdbd1
1 changed files with 3 additions and 2 deletions
5
main.go
5
main.go
|
@ -78,9 +78,10 @@ func readerFromArg(s string) (*Source, error) {
|
||||||
st, err := os.Stat(s)
|
st, err := os.Stat(s)
|
||||||
if len(s) == 0 || (err == nil && st.IsDir()) {
|
if len(s) == 0 || (err == nil && st.IsDir()) {
|
||||||
for _, v := range readmeNames {
|
for _, v := range readmeNames {
|
||||||
r, err := os.Open(filepath.Join(s, v))
|
n := filepath.Join(s, v)
|
||||||
|
r, err := os.Open(n)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
u, _ := filepath.Abs(v)
|
u, _ := filepath.Abs(n)
|
||||||
return &Source{r, u}, nil
|
return &Source{r, u}, nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue