From: Cheng Zhao Date: Mon, 19 Jan 2015 05:31:09 +0000 (-0800) Subject: Add a few more paths for app.getPath X-Git-Tag: v0.20.7~8^2 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=4604c9bb0e417c26990886fc0e64b405c7c9d1d2;p=electron.git Add a few more paths for app.getPath --- diff --git a/atom/browser/api/atom_api_app.cc b/atom/browser/api/atom_api_app.cc index ae2228ff..c7a2a542 100644 --- a/atom/browser/api/atom_api_app.cc +++ b/atom/browser/api/atom_api_app.cc @@ -73,6 +73,14 @@ int GetPathConstant(const std::string& name) { return brightray::DIR_USER_CACHE; else if (name == "home") return base::DIR_HOME; + else if (name == "temp") + return base::DIR_TEMP; + else if (name == "userDesktop") + return base::DIR_USER_DESKTOP; + else if (name == "exe") + return base::FILE_EXE; + else if (name == "module") + return base::FILE_MODULE; else return -1; } diff --git a/docs/api/app.md b/docs/api/app.md index 9462584d..4ac37769 100644 --- a/docs/api/app.md +++ b/docs/api/app.md @@ -106,13 +106,17 @@ You can request following paths by the names: * `$XDG_CONFIG_HOME` or `~/.config` on Linux * `~/Library/Application Support` on OS X * `userData`: The directory for storing your app's configuration files, by - default it is the `appData` directory appended with your app's name. + default it is the `appData` directory appended with your app's name * `cache`: Per-user application cache directory, by default it is pointed to: * `%APPDATA%` on Window, which doesn't has a universal place for cache * `$XDG_CACHE_HOME` or `~/.cache` on Linux * `~/Library/Caches` on OS X * `userCache`: The directory for placing your app's caches, by default it is the - `cache` directory appended with your app's name. + `cache` directory appended with your app's name +* `temp`: Temporary directory +* `userDesktop`: The current user's Desktop directory +* `exe`: The current executable file +* `module`: The `libchromiumcontent` library ## app.setPath(name, path)