Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Platform specific configuration directories #14

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions project.clj
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
[org.clojure/core.async "1.5.648"]
[clojure.java-time "0.3.3"]
[seesaw "1.5.0"]
[dev.dirs/directories "26"]
]
:profiles {:dev {:dependencies [[speclj "3.4.1"]]}}
:plugins [[speclj "3.4.1"]]
Expand Down
29 changes: 16 additions & 13 deletions src/more_speech/config.clj
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
(ns more-speech.config)
(ns more-speech.config
(:require [clojure.string :as string])
(:import (dev.dirs ProjectDirectories))
)

(def default-font "COURIER-PLAIN-14")
(def bold-font "COURIER-BOLD-14")
Expand All @@ -13,18 +16,18 @@

(def test-run? false)
;---configuration files
(def private-directory (atom "private"))
(def migration-filename (atom "private/migration"))
(def nicknames-filename (atom "private/nicknames")) ;grandfathered.
(def profiles-filename (atom "private/profiles"))
(def keys-filename (atom "private/keys"))
(def relays-filename (atom "private/relays"))
(def read-event-ids-filename (atom "private/read-event-ids"))
(def tabs-filename (atom "private/tabs")) ;grandfathered.
(def tabs-list-filename (atom "private/tabs-list"))
(def messages-directory (atom "private/messages"))
(def messages-filename (atom "private/messages/message-file"))
(def user-configuration-filename (atom "private/user-configuration"))
(def private-directory (atom (.-configDir (ProjectDirectories/from "org" "unclebob" "more-speech"))))
(def migration-filename (atom (string/join "/" [@private-directory "migration"])))
(def nicknames-filename (atom (string/join "/" [@private-directory "nicknames"]))) ;grandfathered.
(def profiles-filename (atom (string/join "/" [@private-directory, "profiles"])))
(def keys-filename (atom (string/join "/" [@private-directory, "keys"])))
(def relays-filename (atom (string/join "/" [@private-directory, "relays"])))
(def read-event-ids-filename (atom (string/join "/" [@private-directory, "read-event-ids"])))
(def tabs-filename (atom (string/join "/" [@private-directory, "tabs"]))) ;grandfathered.
(def tabs-list-filename (atom (string/join "/" [@private-directory, "tabs-list"])))
(def messages-directory (atom (string/join "/" [@private-directory, "messages"])))
(def messages-filename (atom (string/join "/" [@private-directory, "messages/message-file"])))
(def user-configuration-filename (atom (string/join "/" [@private-directory, "user-configuration"])))

(def user-name-pattern #"\@[\w\-]+")
(def user-name-chars #"[\w\-]+")