feat(cli): add support for repeated directus tasks
This commit is contained in:
parent
8a12e83b13
commit
1f9e2d856f
11 changed files with 601 additions and 5 deletions
|
@ -111,6 +111,33 @@ export const initConfig = async () => {
|
|||
).bookPath
|
||||
: 'Media assets/books';
|
||||
|
||||
if (config.directus?.apiUrl) {
|
||||
const { updateApiUrl } = await inquirer.prompt([{
|
||||
type: 'confirm',
|
||||
name: 'updateApiUrl',
|
||||
message: `Directus API URL is already set to "${config.directus.apiUrl}". Do you want to update it?`,
|
||||
default: false
|
||||
}]);
|
||||
|
||||
if (updateApiUrl) {
|
||||
const { apiUrl } = await inquirer.prompt([{
|
||||
name: 'apiUrl',
|
||||
message: 'Enter your Directus instance URL:',
|
||||
validate: input => input.startsWith('http') || 'Must be a valid URL'
|
||||
}]);
|
||||
|
||||
config.directus.apiUrl = apiUrl;
|
||||
}
|
||||
} else {
|
||||
const { apiUrl } = await inquirer.prompt([{
|
||||
name: 'apiUrl',
|
||||
message: 'Enter your Directus URL:',
|
||||
validate: input => input.startsWith('http') || 'Must be a valid URL'
|
||||
}]);
|
||||
|
||||
config.directus = { ...(config.directus || {}), apiUrl };
|
||||
}
|
||||
|
||||
config.globals = await fetchGlobals();
|
||||
|
||||
await fs.ensureDir(CACHE_DIR);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue