Skip to content

Commit

Permalink
Merge pull request #193 from AthennaIO/develop
Browse files Browse the repository at this point in the history
feat(npm): only run reload if using package.json
  • Loading branch information
jlenon7 committed Mar 4, 2024
2 parents 0107878 + 57963a0 commit 1dba5f7
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 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/artisan",
"version": "4.39.0",
"version": "4.40.0",
"description": "The Athenna CLI application. Built on top of commander and inspired in @adonisjs/ace.",
"license": "MIT",
"author": "João Lenon <lenon@athenna.io>",
Expand Down
13 changes: 11 additions & 2 deletions src/helpers/command/Npm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
type LinkPackageOptions,
type InstallPackageOptions
} from '@athenna/common'

import { Rc } from '@athenna/config'

export class Npm {
Expand All @@ -35,7 +36,11 @@ export class Npm {
libraries: string | string[],
options?: LinkPackageOptions
) {
await Exec.link(libraries, options).then(() => Rc.reload())
await Exec.link(libraries, options).then(() => {
if (Rc.file.base === 'package.json') {
return Rc.reload()
}
})
}

/**
Expand All @@ -58,6 +63,10 @@ export class Npm {
libraries: string | string[],
options?: InstallPackageOptions
) {
await Exec.install(libraries, options).then(() => Rc.reload())
await Exec.install(libraries, options).then(() => {
if (Rc.file.base === 'package.json') {
return Rc.reload()
}
})
}
}

0 comments on commit 1dba5f7

Please sign in to comment.