Skip to content

Commit

Permalink
update comments, update path to global dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
bdemann committed Sep 18, 2024
1 parent 384aa05 commit 6070a48
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 14 deletions.
12 changes: 3 additions & 9 deletions src/build/stable/commands/install_global_dependencies/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<void> {
// 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?
Expand Down Expand Up @@ -101,17 +99,13 @@ If no options are provided, all dependencies will be installed.
}

async function getGlobalDependencies(): Promise<Versions> {
// 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.');
}

Expand Down
Original file line number Diff line number Diff line change
@@ -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 <DFX_VERSION>"
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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 <NODE_VERSION>"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:]')

Expand Down

0 comments on commit 6070a48

Please sign in to comment.