mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-06 16:58:49 +01:00
Bazaar resource directories support symlink (#8263)
* 🎨 bazaar resource directories support symlink * 🎨 bazaar resource directories support symlink
This commit is contained in:
parent
85496345ef
commit
fdbfe6b848
8 changed files with 38 additions and 19 deletions
|
|
@ -78,7 +78,7 @@ func closeThemeWatchers() {
|
|||
}
|
||||
|
||||
func unloadThemes() {
|
||||
if !gulu.File.IsDir(util.ThemesPath) {
|
||||
if !util.IsPathRegularDirOrSymlinkDir(util.ThemesPath) {
|
||||
return
|
||||
}
|
||||
|
||||
|
|
@ -89,7 +89,7 @@ func unloadThemes() {
|
|||
}
|
||||
|
||||
for _, themeDir := range themeDirs {
|
||||
if !themeDir.IsDir() {
|
||||
if !util.IsDirRegularOrSymlink(themeDir) {
|
||||
continue
|
||||
}
|
||||
unwatchTheme(filepath.Join(util.ThemesPath, themeDir.Name()))
|
||||
|
|
@ -107,7 +107,7 @@ func loadThemes() {
|
|||
Conf.Appearance.DarkThemes = nil
|
||||
Conf.Appearance.LightThemes = nil
|
||||
for _, themeDir := range themeDirs {
|
||||
if !themeDir.IsDir() {
|
||||
if !util.IsDirRegularOrSymlink(themeDir) {
|
||||
continue
|
||||
}
|
||||
name := themeDir.Name()
|
||||
|
|
@ -151,7 +151,7 @@ func loadIcons() {
|
|||
|
||||
Conf.Appearance.Icons = nil
|
||||
for _, iconDir := range iconDirs {
|
||||
if !iconDir.IsDir() {
|
||||
if !util.IsDirRegularOrSymlink(iconDir) {
|
||||
continue
|
||||
}
|
||||
name := iconDir.Name()
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ func GetPackageREADME(repoURL, repoHash, packageType string) (ret string) {
|
|||
func BazaarPlugins() (plugins []*bazaar.Plugin) {
|
||||
plugins = bazaar.Plugins()
|
||||
for _, plugin := range plugins {
|
||||
plugin.Installed = gulu.File.IsDir(filepath.Join(util.DataDir, "plugins", plugin.Name))
|
||||
plugin.Installed = util.IsPathRegularDirOrSymlinkDir(filepath.Join(util.DataDir, "plugins", plugin.Name))
|
||||
if plugin.Installed {
|
||||
if plugin.Installed {
|
||||
if pluginConf, err := bazaar.PluginJSON(plugin.Name); nil == err && nil != plugin {
|
||||
|
|
@ -96,7 +96,7 @@ func UninstallBazaarPlugin(pluginName string) error {
|
|||
func BazaarWidgets() (widgets []*bazaar.Widget) {
|
||||
widgets = bazaar.Widgets()
|
||||
for _, widget := range widgets {
|
||||
widget.Installed = gulu.File.IsDir(filepath.Join(util.DataDir, "widgets", widget.Name))
|
||||
widget.Installed = util.IsPathRegularDirOrSymlinkDir(filepath.Join(util.DataDir, "widgets", widget.Name))
|
||||
if widget.Installed {
|
||||
if widget.Installed {
|
||||
if widgetConf, err := bazaar.WidgetJSON(widget.Name); nil == err && nil != widget {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue