Skip to content

Commit

Permalink
Merge pull request #71 from platformatic/feature/adding-info-in-case-…
Browse files Browse the repository at this point in the history
…import-works

feature/adding-info-in-case-import-works
  • Loading branch information
tonysnowboardunderthebridge authored Dec 7, 2023
2 parents f968e10 + 5983fa2 commit d102119
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.')
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 d102119

Please sign in to comment.