appstash 0.6.0 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/esm/index.d.ts CHANGED
@@ -21,7 +21,7 @@ export interface AppStashResult {
21
21
  * Options for appstash()
22
22
  */
23
23
  export interface AppStashOptions {
24
- /** Base directory (defaults to os.homedir()) */
24
+ /** Base directory (defaults to APPSTASH_BASE_DIR env var, then os.homedir()) */
25
25
  baseDir?: string;
26
26
  /** Use XDG fallback if home fails (default: true) */
27
27
  useXdgFallback?: boolean;
package/esm/index.js CHANGED
@@ -62,6 +62,9 @@ export function appstash(tool, options = {}) {
62
62
  if (baseDir) {
63
63
  base = baseDir;
64
64
  }
65
+ else if (process.env.APPSTASH_BASE_DIR) {
66
+ base = process.env.APPSTASH_BASE_DIR;
67
+ }
65
68
  else {
66
69
  const home = getHomeDir();
67
70
  if (!home) {
package/index.d.ts CHANGED
@@ -21,7 +21,7 @@ export interface AppStashResult {
21
21
  * Options for appstash()
22
22
  */
23
23
  export interface AppStashOptions {
24
- /** Base directory (defaults to os.homedir()) */
24
+ /** Base directory (defaults to APPSTASH_BASE_DIR env var, then os.homedir()) */
25
25
  baseDir?: string;
26
26
  /** Use XDG fallback if home fails (default: true) */
27
27
  useXdgFallback?: boolean;
package/index.js CHANGED
@@ -101,6 +101,9 @@ function appstash(tool, options = {}) {
101
101
  if (baseDir) {
102
102
  base = baseDir;
103
103
  }
104
+ else if (process.env.APPSTASH_BASE_DIR) {
105
+ base = process.env.APPSTASH_BASE_DIR;
106
+ }
104
107
  else {
105
108
  const home = getHomeDir();
106
109
  if (!home) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "appstash",
3
- "version": "0.6.0",
3
+ "version": "0.7.0",
4
4
  "author": "Constructive <developers@constructive.io>",
5
5
  "description": "Simple, clean application directory resolution",
6
6
  "main": "index.js",
@@ -40,5 +40,5 @@
40
40
  "xdg",
41
41
  "appdirs"
42
42
  ],
43
- "gitHead": "276d21250b952f110b9d8a509616ffd1cf5871e7"
43
+ "gitHead": "febc209cbaea97a5976b0554fdb4e1780f6b9618"
44
44
  }