From 57963a08a7f7285f198dbd77e7778affaaa8b2d3 Mon Sep 17 00:00:00 2001 From: jlenon7 Date: Mon, 4 Mar 2024 14:43:58 +0000 Subject: [PATCH] feat(npm): only run reload if using package.json --- package-lock.json | 4 ++-- package.json | 2 +- src/helpers/command/Npm.ts | 13 +++++++++++-- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index d42d02c..be3f787 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@athenna/artisan", - "version": "4.39.0", + "version": "4.40.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@athenna/artisan", - "version": "4.39.0", + "version": "4.40.0", "license": "MIT", "dependencies": { "chalk-rainbow": "^1.0.0", diff --git a/package.json b/package.json index 0230de3..7c804e3 100644 --- a/package.json +++ b/package.json @@ -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 ", diff --git a/src/helpers/command/Npm.ts b/src/helpers/command/Npm.ts index f6f18c7..982a1e4 100644 --- a/src/helpers/command/Npm.ts +++ b/src/helpers/command/Npm.ts @@ -12,6 +12,7 @@ import { type LinkPackageOptions, type InstallPackageOptions } from '@athenna/common' + import { Rc } from '@athenna/config' export class Npm { @@ -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() + } + }) } /** @@ -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() + } + }) } }