feat(cli): add support for repeated directus tasks

This commit is contained in:
Cory Dransfeldt 2025-06-08 17:21:05 -07:00
parent 8a12e83b13
commit 1f9e2d856f
No known key found for this signature in database
11 changed files with 601 additions and 5 deletions

View file

@ -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);