MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / resolveAuthLocation

Function resolveAuthLocation

packages/plugins/file-secrets/src/index.ts:40–60  ·  view source on GitHub ↗
(config: FileSecretsPluginConfig | undefined)

Source from the content-addressed store, hash-verified

38const legacyAuthFilePath = (): string => path.join(xdgDataHome(), APP_NAME, AUTH_FILE_NAME);
39
40const resolveAuthLocation = (config: FileSecretsPluginConfig | undefined): AuthLocation => {
41 if (config?.directory !== undefined) {
42 return {
43 filePath: path.join(config.directory, AUTH_FILE_NAME),
44 legacyFilePath: null,
45 };
46 }
47
48 const dataDir = process.env.EXECUTOR_DATA_DIR?.trim();
49 if (dataDir) {
50 return {
51 filePath: path.join(dataDir, AUTH_FILE_NAME),
52 legacyFilePath: legacyAuthFilePath(),
53 };
54 }
55
56 return {
57 filePath: legacyAuthFilePath(),
58 legacyFilePath: null,
59 };
60};
61
62// ---------------------------------------------------------------------------
63// Schema for the auth file

Callers 1

index.tsFile · 0.85

Calls 1

legacyAuthFilePathFunction · 0.85

Tested by

no test coverage detected