]> khamidou — GitHub mirrors - electron.git/commitdiff
Add a few more paths for app.getPath
authorCheng Zhao <zcbenz@gmail.com>
Mon, 19 Jan 2015 05:31:09 +0000 (21:31 -0800)
committerCheng Zhao <zcbenz@gmail.com>
Mon, 19 Jan 2015 05:43:23 +0000 (21:43 -0800)
atom/browser/api/atom_api_app.cc
docs/api/app.md

index ae2228ff941dc65a63f85c19e2e79f4dcde3b3bc..c7a2a542d1d8e0fb532f2b832a088268a5725da4 100644 (file)
@@ -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;
 }
index 9462584d32bb88f63d08f402fb0899a6d57440eb..4ac377692622ac1454025438af8a2e5a7f68b3b6 100644 (file)
@@ -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)