Do not create the folder passed to app.setPath
This commit is contained in:
parent
1c75baa8b3
commit
df97be30e5
1 changed files with 6 additions and 1 deletions
|
@ -351,10 +351,15 @@ base::FilePath App::GetPath(mate::Arguments* args, const std::string& name) {
|
||||||
void App::SetPath(mate::Arguments* args,
|
void App::SetPath(mate::Arguments* args,
|
||||||
const std::string& name,
|
const std::string& name,
|
||||||
const base::FilePath& path) {
|
const base::FilePath& path) {
|
||||||
|
if (!path.IsAbsolute()) {
|
||||||
|
args->ThrowError("path must be absolute");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
bool succeed = false;
|
bool succeed = false;
|
||||||
int key = GetPathConstant(name);
|
int key = GetPathConstant(name);
|
||||||
if (key >= 0)
|
if (key >= 0)
|
||||||
succeed = PathService::Override(key, path);
|
succeed = PathService::OverrideAndCreateIfNeeded(key, path, true, false);
|
||||||
if (!succeed)
|
if (!succeed)
|
||||||
args->ThrowError("Failed to set path");
|
args->ThrowError("Failed to set path");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue