Skip to content

Commit

Permalink
fix: fix incorrect loading of package.json (#737)
Browse files Browse the repository at this point in the history
Signed-off-by: Jeromy Cannon <[email protected]>
  • Loading branch information
jeromy-cannon authored Oct 23, 2024
1 parent 15f5df6 commit 12623f9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
"name": "@hashgraph/solo",
"version": "0.31.3",
"description": "An opinionated CLI tool to deploy and manage private Hedera Networks.",
"main": "dist/src/index.js",
"main": "./dist/src/index.js",
"type": "module",
"bin": {
"solo": "dist/solo.js"
"solo": "./dist/solo.js"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion resources/post-build-script.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const __dirname = path.dirname(fileURLToPath(import.meta.url))
//! Target directory
const distDir = path.resolve(__dirname, '../dist')
const srcPackageJsonFilePath = path.resolve(__dirname, '../package.json')
const targetPackageJsonFilePath = path.join(distDir, 'src', 'package.json')
const targetPackageJsonFilePath = path.join(distDir, 'package.json')
const srcResourcesDir = path.join(__dirname, '../resources')
const targetResourcesDir = path.join(distDir, 'resources')

Expand Down
5 changes: 2 additions & 3 deletions src/core/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import util from 'util'
import { SoloError } from './errors.ts'
import * as semver from 'semver'
import { Templates } from './templates.ts'
import { HEDERA_HAPI_PATH, ROOT_CONTAINER, SOLO_LOGS_DIR } from './constants.ts'
import { HEDERA_HAPI_PATH, ROOT_CONTAINER, ROOT_DIR, SOLO_LOGS_DIR } from './constants.ts'
import { constants, type K8 } from './index.ts'
import { FileContentsQuery, FileId, PrivateKey, ServiceEndpoint } from '@hashgraph/sdk'
import { Listr } from 'listr2'
Expand Down Expand Up @@ -64,8 +64,7 @@ export function cloneArray <T> (arr: T[]): T[] {
/** load package.json */
export function loadPackageJSON (): any {
try {
const rootDir = process.cwd()
const raw = fs.readFileSync(path.join(rootDir, 'package.json'))
const raw = fs.readFileSync(path.join(ROOT_DIR, 'package.json'))
return JSON.parse(raw.toString())
} catch (e: Error | any) {
throw new SoloError('failed to load package.json', e)
Expand Down

0 comments on commit 12623f9

Please sign in to comment.