diff --git a/src/config.cpp b/src/config.cpp index aeef1c1..9f4865e 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -22,7 +22,7 @@ config::~config() { } bool config::load_config() { - std::string config_path = localfile::dropshell_conf(); + std::string config_path = localfile::dropshell_env(); if (config_path.empty() || !std::filesystem::exists(config_path)) return false; @@ -56,10 +56,10 @@ void config::save_config() return; } - std::string parent_path = dropshell::get_parent(localfile::dropshell_conf()); + std::string parent_path = dropshell::get_parent(localfile::dropshell_env()); std::filesystem::create_directories(parent_path); - std::string config_path = localfile::dropshell_conf(); + std::string config_path = localfile::dropshell_env(); envmanager config_env(config_path); config_env.set_variable("local.config.directories", multi2string(mLocalConfigPaths)); diff --git a/src/main.cpp b/src/main.cpp index c6a8ef4..74e91a7 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -114,7 +114,7 @@ int main(int argc, char* argv[]) { } if (cmd == "edit" && argc < 3) { - std::string config_file = dropshell::localfile::dropshell_conf(); + std::string config_file = dropshell::localfile::dropshell_env(); std::filesystem::create_directories( dropshell::get_parent(config_file) ); dropshell::edit_file(config_file, "Please ensure any directories you have introduced in the config file exist."); return 0; diff --git a/src/utils/directories.cpp b/src/utils/directories.cpp index 39478af..76dbe28 100644 --- a/src/utils/directories.cpp +++ b/src/utils/directories.cpp @@ -11,11 +11,11 @@ namespace dropshell { namespace localfile { - std::string dropshell_conf() { - // Try ~/.config/dropshell/dropshell.conf + std::string dropshell_env() { + // Try ~/.config/dropshell/dropshell.env const char* home = std::getenv("HOME"); if (home) { - fs::path user_path = fs::path(home) / ".config" / "dropshell" / "dropshell.conf"; + fs::path user_path = fs::path(home) / ".config" / "dropshell" / "dropshell.env"; return user_path.string(); } std::cerr << "Warning: Couldn't determine user directory" << std::endl; diff --git a/src/utils/directories.hpp b/src/utils/directories.hpp index 32d484f..e10e733 100644 --- a/src/utils/directories.hpp +++ b/src/utils/directories.hpp @@ -28,7 +28,7 @@ namespace dropshell { // | |-- service_name.hash.env namespace localfile { // ~/.config/dropshell/dropshell.conf - std::string dropshell_conf(); + std::string dropshell_env(); std::string server_env(const std::string &server_name); std::string service_env(const std::string &server_name, const std::string &service_name); std::string service_hash(const std::string &server_name, const std::string &service_name);