Change config file path.
Some checks reported errors
continuous-integration/drone/push Build was killed
Some checks reported errors
continuous-integration/drone/push Build was killed
Existing old config file is copied over.
This commit is contained in:
parent
b966be3021
commit
77d013c12a
|
@ -2,7 +2,7 @@
|
||||||
:doctype: manpage
|
:doctype: manpage
|
||||||
:Author: tastytea
|
:Author: tastytea
|
||||||
:Email: tastytea@tastytea.de
|
:Email: tastytea@tastytea.de
|
||||||
:Date: 2021-05-30
|
:Date: 2021-05-31
|
||||||
:Revision: 0.0.0
|
:Revision: 0.0.0
|
||||||
:man source: epubgrep
|
:man source: epubgrep
|
||||||
:man manual: General Commands Manual
|
:man manual: General Commands Manual
|
||||||
|
@ -130,8 +130,8 @@ regexp = [Oo]regano
|
||||||
== FILES
|
== FILES
|
||||||
|
|
||||||
*Configuration file*::
|
*Configuration file*::
|
||||||
* If `XDG_CONFIG_HOME` is defined: `${XDG_CONFIG_HOME}/epubgrep.conf`
|
* If `XDG_CONFIG_HOME` is defined: `${XDG_CONFIG_HOME}/epubgrep/epubgrep.conf`
|
||||||
* If `HOME` is defined: `${HOME}/.config/epubgrep.conf`
|
* If `HOME` is defined: `${HOME}/.config/epubgrep/epubgrep.conf`
|
||||||
* Otherwise: `epubgrep.conf`
|
* Otherwise: `epubgrep.conf`
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -161,7 +161,16 @@ fs::path get_config_path()
|
||||||
}
|
}
|
||||||
if (!path.empty())
|
if (!path.empty())
|
||||||
{
|
{
|
||||||
return path /= "epubgrep.conf";
|
const auto old_path{path / "epubgrep.conf"};
|
||||||
|
auto new_path{path / "epubgrep" / "epubgrep.conf"};
|
||||||
|
|
||||||
|
if (fs::exists(old_path))
|
||||||
|
{
|
||||||
|
fs::create_directory(path /= "epubgrep");
|
||||||
|
fs::rename(old_path, new_path);
|
||||||
|
}
|
||||||
|
|
||||||
|
return new_path;
|
||||||
}
|
}
|
||||||
|
|
||||||
return "epubgrep.conf";
|
return "epubgrep.conf";
|
||||||
|
|
Loading…
Reference in New Issue
Block a user