Skip to content

Commit

Permalink
fixup into more consistent version checking
Browse files Browse the repository at this point in the history
  • Loading branch information
bdemann committed Sep 17, 2024
1 parent 2501c02 commit 9b797c9
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ If no options are provided, all dependencies will be installed.

async function getGlobalDependencies(): Promise<Versions> {
// Path to package.json
const packageJsonPath = join(process.cwd(), 'package.json');
const packageJsonPath = join(AZLE_PACKAGE_PATH, 'package.json');

// Read the existing package.json file
const packageJsonContent = await readFile(packageJsonPath, 'utf-8');
Expand Down
4 changes: 3 additions & 1 deletion src/build/stable/utils/versions/dfx.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { pathToFileURL } from 'url';

import { execSyncPretty } from '../exec_sync_pretty';

export function getDfxVersion(): string {
Expand All @@ -22,6 +24,6 @@ function main(): void {
}
}

if (require.main === module) {
if (import.meta.url === pathToFileURL(process.argv[1]).href) {
main();
}
4 changes: 3 additions & 1 deletion src/build/stable/utils/versions/node.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { pathToFileURL } from 'url';

import { execSyncPretty } from '../exec_sync_pretty';

export function getNodeVersion(): string {
Expand All @@ -21,6 +23,6 @@ function main(): void {
}
}

if (require.main === module) {
if (import.meta.url === pathToFileURL(process.argv[1]).href) {
main();
}
4 changes: 3 additions & 1 deletion src/build/stable/utils/versions/rust.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { pathToFileURL } from 'url';

import { execSyncPretty } from '../exec_sync_pretty';

export function getRustVersion(): string {
Expand All @@ -21,6 +23,6 @@ function main(): void {
}
}

if (require.main === module) {
if (import.meta.url === pathToFileURL(process.argv[1]).href) {
main();
}
4 changes: 3 additions & 1 deletion src/build/stable/utils/versions/wasi2ic.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { pathToFileURL } from 'url';

import { execSyncPretty } from '../exec_sync_pretty';

export function getWasiVersion(): string {
Expand Down Expand Up @@ -34,6 +36,6 @@ function main(): void {
}
}

if (require.main === module) {
if (import.meta.url === pathToFileURL(process.argv[1]).href) {
main();
}

0 comments on commit 9b797c9

Please sign in to comment.