-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
dffc4e9
commit a0954e1
Showing
11 changed files
with
91 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import console from 'node:console' | ||
import fs from 'node:fs/promises' | ||
|
||
import config from '#src/config.js' | ||
import configure from '#src/provider/configure.js' | ||
import { loadConfig, getProviders } from '#src/utils.js' | ||
|
||
/** | ||
* Configure the application | ||
*/ | ||
export default async () => { | ||
const appConfig = await loadConfig() | ||
|
||
appConfig.defaultTo = await question( | ||
'On which email do you want a redirection by default ? ', | ||
{ | ||
choices: [appConfig.defaultTo], | ||
} | ||
) | ||
|
||
const providers = await getProviders() | ||
|
||
appConfig.provider = await question('Which provider will you use ? ', { | ||
choices: providers, | ||
}) | ||
|
||
await fs.writeFile(config.path, JSON.stringify(appConfig, undefined, 2)) | ||
|
||
console.log('Successfully configure email-alias ! Yai !') | ||
|
||
const shouldConfigProvider = await question( | ||
`Do you want to configure the ${appConfig.provider} provider ? `, | ||
{ | ||
choices: ['Yes', 'No'], | ||
} | ||
) | ||
|
||
if (shouldConfigProvider === 'Yes') { | ||
await configure(appConfig.provider) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import console from 'node:console' | ||
|
||
import { loadConfig } from '#src/utils.js' | ||
|
||
/** | ||
* Print the app configuration | ||
*/ | ||
export default async () => { | ||
const config = await loadConfig() | ||
console.log(config) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters