(config: FileSecretsPluginConfig | undefined)
| 38 | const legacyAuthFilePath = (): string => path.join(xdgDataHome(), APP_NAME, AUTH_FILE_NAME); |
| 39 | |
| 40 | const 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 |
no test coverage detected