Skip to content

Commit

Permalink
fix generator error
Browse files Browse the repository at this point in the history
  • Loading branch information
glepnir committed May 11, 2020
1 parent 7e67422 commit 678368e
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,20 +99,22 @@ func colorscheme(filename string) {
var wg sync.WaitGroup
for _, v := range colorschemes {
wg.Add(1)
repo := fmt.Sprintf("- { repo: %s }", v)
go func(wg *sync.WaitGroup) {
var mu sync.RWMutex
mu.RLock()
defer mu.RUnlock()
f, _ := os.OpenFile(filename, os.O_CREATE|os.O_APPEND|os.O_WRONLY, 0644)
defer f.Close()
_, err := f.WriteString(repo)
if err != nil {
log.Fatalf("Write colorscheme to %s failed error:%s", filename, err)
os.Exit(1)
}
wg.Done()
}(&wg)
if v != "hardcoreplayers/oceanic-material(support by default)" {
repo := fmt.Sprintf("- { repo: %s }", v)
go func(wg *sync.WaitGroup) {
var mu sync.RWMutex
mu.RLock()
defer mu.RUnlock()
f, _ := os.OpenFile(filename, os.O_CREATE|os.O_APPEND|os.O_WRONLY, 0644)
defer f.Close()
_, err := f.WriteString(repo)
if err != nil {
log.Fatalf("Write colorscheme to %s failed error:%s", filename, err)
os.Exit(1)
}
wg.Done()
}(&wg)
}
}
wg.Wait()
themecache := homepath + "/.cache/vim/theme.txt"
Expand Down

0 comments on commit 678368e

Please sign in to comment.