Skip to content

Commit

Permalink
Always ensure config directory on daemon start
Browse files Browse the repository at this point in the history
  • Loading branch information
halo committed Mar 3, 2024
1 parent bf71a4e commit a9965e8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion linkdaemon/Classes/ConfigDirectory.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import Foundation
struct ConfigDirectory {
// MARK: Class Methods

static func create() {
static func ensure() {
ensureDirectory()
ensureDirectoryPermissions()
ensureFile()
Expand Down
2 changes: 1 addition & 1 deletion linkdaemon/Classes/Listener.swift
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ extension Listener: ListenerProtocol {
// Log.debug("now!")
// Log.debug(uncachedBundle.infoDictionary?["CFBundleShortVersionString"]! as! String)

ConfigDirectory.create()
ConfigDirectory.ensure()
reply(true)
}

Expand Down
2 changes: 2 additions & 0 deletions linkdaemon/LinkDaemon.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ class LinkDaemon {
// MARK: Private Instance Methods

private func subscribe() {
ConfigDirectory.ensure()

// Start observing the config file.
configFileObserver = FileObserver(path: Paths.configFile, callback: configFileChanged)

Expand Down

0 comments on commit a9965e8

Please sign in to comment.