mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2024-12-31 13:57:26 -08:00
parent
0dbe5f2aa4
commit
ad12ad8ed2
|
@ -4,6 +4,7 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"os"
|
"os"
|
||||||
|
"strings"
|
||||||
|
|
||||||
"github.com/charmbracelet/bubbles/list"
|
"github.com/charmbracelet/bubbles/list"
|
||||||
"github.com/charmbracelet/bubbles/spinner"
|
"github.com/charmbracelet/bubbles/spinner"
|
||||||
|
@ -124,9 +125,11 @@ func installFontZIP(zipFile []byte) {
|
||||||
func (m *main) Init() tea.Cmd {
|
func (m *main) Init() tea.Cmd {
|
||||||
if len(m.fontname) != 0 {
|
if len(m.fontname) != 0 {
|
||||||
m.state = downloadFont
|
m.state = downloadFont
|
||||||
url := fmt.Sprintf("https://github.com/ryanoasis/nerd-fonts/releases/latest/download/%s.zip", m.fontname)
|
if !strings.HasPrefix(m.fontname, "https") {
|
||||||
|
m.fontname = fmt.Sprintf("https://github.com/ryanoasis/nerd-fonts/releases/latest/download/%s.zip", m.fontname)
|
||||||
|
}
|
||||||
defer func() {
|
defer func() {
|
||||||
go downloadFontZip(url)
|
go downloadFontZip(m.fontname)
|
||||||
}()
|
}()
|
||||||
m.spinner.Spinner = spinner.Globe
|
m.spinner.Spinner = spinner.Globe
|
||||||
return m.spinner.Tick
|
return m.spinner.Tick
|
||||||
|
|
Loading…
Reference in a new issue