diff --git a/src/build/stable/commands/install_global_dependencies/index.ts b/src/build/stable/commands/install_global_dependencies/index.ts index 1016f0ef24..2388143049 100644 --- a/src/build/stable/commands/install_global_dependencies/index.ts +++ b/src/build/stable/commands/install_global_dependencies/index.ts @@ -22,8 +22,6 @@ const validFlags = { wasi2ic: { name: 'wasi2ic', script: 'install_wasi2ic.sh' } }; -// TODO don't forget, we do want a separate script to get all of these versions so that we can run it as an action. We want this because we are not the ones that install node for the github workflows - export async function runCommand(ioType: IOType): Promise { // TODO Hey Jordan, I was noticing that for all of the other commands the handling of flags happens before we get to this point. // TODO I am guessing that is because of flags like experimental that apply to all of the commands? @@ -101,17 +99,13 @@ If no options are provided, all dependencies will be installed. } async function getGlobalDependencies(): Promise { - // Path to package.json const packageJsonPath = join(AZLE_PACKAGE_PATH, 'package.json'); - // Read the existing package.json file - const packageJsonContent = await readFile(packageJsonPath, 'utf-8'); - const packageJson = JSON.parse(packageJsonContent); + const packageJson = JSON.parse(await readFile(packageJsonPath, 'utf-8')); - // Extract globalDependencies - const globalDependencies = packageJson.globalDependencies; + const globalDependencies = packageJson.azle.globalDependencies; - if (!globalDependencies) { + if (globalDependencies === undefined) { throw new Error('No globalDependencies found in package.json.'); } diff --git a/src/build/stable/commands/install_global_dependencies/install_dfx.sh b/src/build/stable/commands/install_global_dependencies/install_dfx.sh index 78c15e21f5..29e8b7c5bd 100755 --- a/src/build/stable/commands/install_global_dependencies/install_dfx.sh +++ b/src/build/stable/commands/install_global_dependencies/install_dfx.sh @@ -1,6 +1,5 @@ #!/bin/bash -# Ensure that a version argument is passed if [ -z "$1" ]; then echo "Error: No DFX version specified." echo "Usage: ./install_dfx.sh " @@ -9,14 +8,12 @@ fi DFX_VERSION=$1 -# Check if dfx is installed and its version if command -v dfx &> /dev/null; then INSTALLED_VERSION=$(npx tsx src/build/stable/utils/versions/dfx.ts 2>&1 | tr -d '[:space:]') echo "Installed dfx version: $INSTALLED_VERSION" echo "Requested dfx version: $DFX_VERSION" - # If the installed version matches the requested version, skip installation if [ "$INSTALLED_VERSION" = "$DFX_VERSION" ]; then echo "dfx $DFX_VERSION is already installed. No installation needed." exit 0 diff --git a/src/build/stable/commands/install_global_dependencies/install_node.sh b/src/build/stable/commands/install_global_dependencies/install_node.sh index 51a5799fd1..d2e67b998c 100755 --- a/src/build/stable/commands/install_global_dependencies/install_node.sh +++ b/src/build/stable/commands/install_global_dependencies/install_node.sh @@ -1,6 +1,5 @@ #!/bin/bash -# Ensure that a version argument is passed if [ -z "$1" ]; then echo "Error: No Node.js version specified." echo "Usage: ./install_node.sh " diff --git a/src/build/stable/commands/install_global_dependencies/install_rust.sh b/src/build/stable/commands/install_global_dependencies/install_rust.sh index bbb55dc549..4e20123c7b 100755 --- a/src/build/stable/commands/install_global_dependencies/install_rust.sh +++ b/src/build/stable/commands/install_global_dependencies/install_rust.sh @@ -8,7 +8,6 @@ fi RUST_VERSION=$1 -# Check if Rust is installed and its version if command -v rustc &> /dev/null; then INSTALLED_VERSION=$(npx tsx src/build/stable/utils/versions/rust.ts 2>&1 | tr -d '[:space:]')