appstash 0.6.0 → 0.7.1

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;
@@ -97,5 +97,5 @@ export declare function ensure(dirs: AppStashResult): EnsureResult;
97
97
  * ```
98
98
  */
99
99
  export declare function resolve(dirs: AppStashResult, kind: 'config' | 'cache' | 'data' | 'logs' | 'tmp', ...parts: string[]): string;
100
- export { createConfigStore } from './config-store';
101
100
  export type { ClientConfig, ConfigStore, ConfigStoreOptions, ContextConfig, ContextCredentials, ContextTargetEndpoint, Credentials, GlobalSettings, } from './config-store';
101
+ export { createConfigStore } from './config-store';
package/esm/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as fs from 'fs';
2
- import * as path from 'path';
3
2
  import * as os from 'os';
3
+ import * as path from 'path';
4
4
  /**
5
5
  * Get home directory with fallback
6
6
  */
@@ -12,6 +12,7 @@ function getHomeDir() {
12
12
  }
13
13
  }
14
14
  catch {
15
+ // ignore
15
16
  }
16
17
  return null;
17
18
  }
@@ -62,6 +63,9 @@ export function appstash(tool, options = {}) {
62
63
  if (baseDir) {
63
64
  base = baseDir;
64
65
  }
66
+ else if (process.env.APPSTASH_BASE_DIR) {
67
+ base = process.env.APPSTASH_BASE_DIR;
68
+ }
65
69
  else {
66
70
  const home = getHomeDir();
67
71
  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;
@@ -97,5 +97,5 @@ export declare function ensure(dirs: AppStashResult): EnsureResult;
97
97
  * ```
98
98
  */
99
99
  export declare function resolve(dirs: AppStashResult, kind: 'config' | 'cache' | 'data' | 'logs' | 'tmp', ...parts: string[]): string;
100
- export { createConfigStore } from './config-store';
101
100
  export type { ClientConfig, ConfigStore, ConfigStoreOptions, ContextConfig, ContextCredentials, ContextTargetEndpoint, Credentials, GlobalSettings, } from './config-store';
101
+ export { createConfigStore } from './config-store';
package/index.js CHANGED
@@ -38,8 +38,8 @@ exports.appstash = appstash;
38
38
  exports.ensure = ensure;
39
39
  exports.resolve = resolve;
40
40
  const fs = __importStar(require("fs"));
41
- const path = __importStar(require("path"));
42
41
  const os = __importStar(require("os"));
42
+ const path = __importStar(require("path"));
43
43
  /**
44
44
  * Get home directory with fallback
45
45
  */
@@ -51,6 +51,7 @@ function getHomeDir() {
51
51
  }
52
52
  }
53
53
  catch {
54
+ // ignore
54
55
  }
55
56
  return null;
56
57
  }
@@ -101,6 +102,9 @@ function appstash(tool, options = {}) {
101
102
  if (baseDir) {
102
103
  base = baseDir;
103
104
  }
105
+ else if (process.env.APPSTASH_BASE_DIR) {
106
+ base = process.env.APPSTASH_BASE_DIR;
107
+ }
104
108
  else {
105
109
  const home = getHomeDir();
106
110
  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.1",
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": "2985d68020ec7d1eeae9a839bdb7ebb68727dd55"
44
44
  }