Skip to content

Commit

Permalink
feat(js):new fileExists api
Browse files Browse the repository at this point in the history
  • Loading branch information
yichere authored May 3, 2024
1 parent f9e5be7 commit 66bd4f7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions dice/js_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,3 +119,8 @@ func (i *ExtInfo) FileRead(name string) string {
}
return string(content)
}

func (i *ExtInfo) FileExists(filePath string) bool {
_, err := os.Stat(filePath)
return !os.IsNotExist(err)
}

0 comments on commit 66bd4f7

Please sign in to comment.