Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix incorrect loading of package.json #737

Merged
merged 1 commit into from
Oct 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading