Skip to content

Commit

Permalink
feat: send info in case exist already a node_modules installed global…
Browse files Browse the repository at this point in the history
…ly or on upper folder

Signed-off-by: Antonio Sonis <[email protected]>
  • Loading branch information
tonysnowboardunderthebridge committed Dec 7, 2023
1 parent f968e10 commit 29d2058
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/main/lib/import-or-local.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ import { runCommand } from './run-command.mjs'

async function importOrLocal ({ pkgManager, projectDir, pkg, logger }) {
try {
return await import(pkg)
logger.info(`Installing ${pkg} on ${projectDir}...`)
await import(pkg)
logger.info(`During installation we found that there are upper folders with node_modules installed or there is a global installation.`)

Check failure on line 11 in src/main/lib/import-or-local.mjs

View workflow job for this annotation

GitHub Actions / test

Strings must use singlequote
return null
} catch (err) {
// This file does not need to exists, will be created automatically
const pkgJsonPath = path.join(projectDir, 'package.json')
Expand All @@ -17,8 +20,6 @@ async function importOrLocal ({ pkgManager, projectDir, pkg, logger }) {
return await import(pathToFileURL(fileToImport))
} catch (err) {}

logger.info(`Installing ${pkg} on ${projectDir}...`)

const child = runCommand(pkgManager, ['install', pkg], { cwd: projectDir })

child.stdout.pipe(split()).on('data', (line) => {
Expand Down

0 comments on commit 29d2058

Please sign in to comment.