Skip to content

Commit 809f41b

Browse files
authored
Merge pull request #15 from ShiSui97x/feature/custom-notes-path
fix: prevent redundant folders when using custom notes path
2 parents e28902b + c8a5e04 commit 809f41b

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

  • QuickNotes/Community.PowerToys.Run.Plugin.QuickNotes

QuickNotes/Community.PowerToys.Run.Plugin.QuickNotes/Main.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -267,11 +267,11 @@ public void Init(PluginInitContext context)
267267
Context.API.ThemeChanged += OnThemeChanged;
268268

269269
var customPath = Environment.GetEnvironmentVariable(CUSTOM_PATH_ENV_VAR);
270-
var appDataPath = string.IsNullOrEmpty(customPath)
271-
? Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData)
270+
var appDataPath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
271+
var powerToysPath = string.IsNullOrEmpty(customPath)
272+
? Path.Combine(appDataPath, "Microsoft", "PowerToys", "QuickNotes")
272273
: customPath;
273-
274-
var powerToysPath = Path.Combine(appDataPath, "Microsoft", "PowerToys", "QuickNotes");
274+
275275
if (!Directory.Exists(powerToysPath))
276276
Directory.CreateDirectory(powerToysPath);
277277

0 commit comments

Comments
 (0)