(env: NodeJS.ProcessEnv = process.env)
| 47 | } |
| 48 | |
| 49 | export function loadDevspaceFiles(env: NodeJS.ProcessEnv = process.env): DevspaceFiles { |
| 50 | const dir = devspaceConfigDir(env); |
| 51 | const configPath = join(dir, "config.json"); |
| 52 | const authPath = join(dir, "auth.json"); |
| 53 | const configExists = existsSync(configPath); |
| 54 | const authExists = existsSync(authPath); |
| 55 | |
| 56 | return { |
| 57 | dir, |
| 58 | configPath, |
| 59 | authPath, |
| 60 | configExists, |
| 61 | authExists, |
| 62 | config: configExists ? readJsonFile<DevspaceUserConfig>(configPath) : {}, |
| 63 | auth: authExists ? readJsonFile<DevspaceAuthConfig>(authPath) : {}, |
| 64 | }; |
| 65 | } |
| 66 | |
| 67 | export function writeDevspaceConfig( |
| 68 | config: DevspaceUserConfig, |
no test coverage detected