Skip to content

Commit

Permalink
feat(cmd): add better logs to install command
Browse files Browse the repository at this point in the history
  • Loading branch information
jlenon7 committed Mar 4, 2024
1 parent aacf38c commit 2f1329b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 14 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@athenna/core",
"version": "4.31.0",
"version": "4.32.0",
"description": "One foundation for multiple applications.",
"license": "MIT",
"author": "João Lenon <[email protected]>",
Expand Down
21 changes: 10 additions & 11 deletions src/commands/InstallCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { Argument, BaseCommand, Option } from '@athenna/artisan'

export class InstallCommand extends BaseCommand {
@Argument({
signature: '<...libraries>',
signature: 'libraries...',
description: 'The libraries to install in your project.'
})
public libraries: string[]
Expand Down Expand Up @@ -52,24 +52,23 @@ export class InstallCommand extends BaseCommand {
})
})

console.log()
this.logger.success(
`Successfully installed ${this.libraries.join(', ')} libraries`
)

for (const library of this.libraries) {
const path = Path.nodeModules(`${library}/configurer/index.js`)

if (!(await File.exists(path))) {
continue
}

task.addPromise(`Configuring ${library}`, async () => {
const Configurer = await Module.getFrom(path)
this.logger.simple(`\n({bold,green} [ CONFIGURING ${library} ])\n`)

return new Configurer().setPath(path).configure()
})
}
const Configurer = await Module.getFrom(path)

await task.run()

this.logger.success(
`Successfully installed ${this.libraries.join(', ')} libraries`
)
await new Configurer().setPath(path).configure()
}
}
}

0 comments on commit 2f1329b

Please sign in to comment.