Skip to content

Commit

Permalink
fix: download openGemini package if not exist
Browse files Browse the repository at this point in the history
Signed-off-by: shilinlee <836160610@qq.com>
  • Loading branch information
shilinlee committed Nov 16, 2023
1 parent 8f80701 commit a438e9d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/cluster/operation/download.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,12 @@ func (d *GeminiDownloader) isExistedFile() (bool, error) {
fs, err := ioutil.ReadDir(dir)
if err != nil {
return false, err
} else if len(fs) != 1 {
} else if len(fs) > 1 {
return false, fmt.Errorf("more than one offline installation package file at %s", dir)
} else if len(fs) == 0 {
return false, nil
}
// offline installation package
d.fileName = filepath.Join(dir, fs[0].Name())
return true, nil
}
Expand Down

0 comments on commit a438e9d

Please sign in to comment.