Skip to content

Commit

Permalink
Merge pull request #157 from AthennaIO/develop
Browse files Browse the repository at this point in the history
chore(ignite): set rc.callPath before loading root path
  • Loading branch information
jlenon7 authored Mar 26, 2023
2 parents 0cace2c + 2f3f7c6 commit 809f736
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 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": "3.2.0",
"version": "3.3.0",
"description": "The plug and play Node.js framework.",
"license": "MIT",
"author": "João Lenon <[email protected]>",
Expand Down
10 changes: 9 additions & 1 deletion src/Ignite/Ignite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,10 @@ export class Ignite {
* ```
*/
public setApplicationRootPath(): void {
if (!Config.exists('rc.callPath')) {
Config.set('rc.callPath', process.cwd())
}

if (!process.env.CORE_TESTING) {
const __dirname = Module.createDirname(import.meta.url)

Expand Down Expand Up @@ -303,7 +307,11 @@ export class Ignite {
*/
public async setRcContentAndAppVars() {
const file = new File(this.options.athennaRcPath, '')
const pkgJson = await new File(Path.pwd('package.json')).getContentAsJson()
const pkgJsonFile = new File(Path.pwd('package.json'), '')

const pkgJson = pkgJsonFile.fileExists
? await pkgJsonFile.getContentAsJson()
: {}
const corePkgJson = await new File('../../package.json').getContentAsJson()
const coreSemverVersion = this.parseVersion(corePkgJson.version)

Expand Down

0 comments on commit 809f736

Please sign in to comment.