diff --git a/src/commands/init.ts b/src/commands/init.ts index d0c3058..c416bb5 100644 --- a/src/commands/init.ts +++ b/src/commands/init.ts @@ -53,7 +53,8 @@ const initConfig = async () => { satellite: {id: satelliteId, source}, ...(nonNullish(orbiterId) && {orbiter: {id: orbiterId}}) }, - configType + configType, + configPath: originalConfigPath }); // We delete the deprecated juno.json, which is now replaced with juno.config.json|ts|js, as just created above. diff --git a/src/configs/juno.config.ts b/src/configs/juno.config.ts index 3f15d91..0806943 100644 --- a/src/configs/juno.config.ts +++ b/src/configs/juno.config.ts @@ -27,10 +27,12 @@ export const junoConfigFile = (): {configPath: string; configType: ConfigType} = export const writeJunoConfig = async ({ config, - configType + configType, + configPath }: { config: JunoConfigWithSatelliteId; configType: ConfigType; + configPath: string | undefined; }): Promise => { switch (configType) { case 'ts': @@ -52,7 +54,7 @@ export const writeJunoConfig = async ({ .replace('', source ?? DEPLOY_DEFAULT_SOURCE) .replace('', orbiter?.id ?? ''); - await writeFile(`${JUNO_CONFIG_FILENAME}.${configType}`, content, 'utf-8'); + await writeFile(configPath ?? `${JUNO_CONFIG_FILENAME}.${configType}`, content, 'utf-8'); break; } default: {