Skip to content

Conversation

@Frack91
Copy link
Contributor

@Frack91 Frack91 commented Oct 21, 2024

The core.LoadPlugin() function has been refactored to consider XDG_DATA_DIRS (from the FDO basedir spec) instead of having hardcoded paths. By doing so, there is no need to put "plugins.in" through sed anymore. Also, for this reason, the file has been renamed to "plugins.go" and has been removed from .gitignore and Makefile.

The core.LoadPlugin() function has been refactored to consider XDG_DATA_DIRS
(from the FDO basedir spec) instead of having hardcoded paths. By doing so,
there is no need to put "plugins.in" through sed anymore. Also, for this reason,
the file has been renamed to "plugins.go" and has been removed from .gitignore
and Makefile.
This commit reverts changes done to Makefile and core/plugins.in,
and corrects some explanation comments accordingly.
@Frack91 Frack91 requested a review from axtloss October 21, 2024 21:41
Comment on lines +28 to +29
globalPluginPathsEnv, isGPPEDefined := os.LookupEnv("XDG_DATA_DIRS")
if !isGPPEDefined || globalPluginPathsEnv == "" {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
globalPluginPathsEnv, isGPPEDefined := os.LookupEnv("XDG_DATA_DIRS")
if !isGPPEDefined || globalPluginPathsEnv == "" {
globalPluginPathsEnv, isGPPEDefined := os.LookupEnv("XDG_DATA_DIRS")
if !isGPPEDefined || len(strings.TrimSpace(globalPluginPathsEnv)) == "" {

just checking if its equal to "" wouldn't work since the envvar can be just a single space or some other whitespace
also what does GPPEDefined mean? I think something like XDDDefined would make more sense

@axtloss axtloss changed the base branch from main to feat/use-xdg_data_dirs January 21, 2025 07:56
@axtloss axtloss merged commit 8e808b7 into Vanilla-OS:feat/use-xdg_data_dirs Jan 21, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants