Skip to content
This repository has been archived by the owner on Sep 9, 2024. It is now read-only.

Commit

Permalink
updated script for people who dont have npm or yarn installed
Browse files Browse the repository at this point in the history
  • Loading branch information
PatrickAlphaC committed Mar 19, 2024
1 parent c4ba155 commit 103b179
Showing 1 changed file with 19 additions and 8 deletions.
27 changes: 19 additions & 8 deletions scripts/binary_check.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,22 @@
#! /bin/bash

if ! [[ "$(npm list -g huffc)" =~ "empty" ]]; then
# huffc was installed via npm, return 0x00
echo -n 0x00
elif [[ "$(yarn global list)" =~ "huffc" ]]; then
# huffc was installed via yarn, return 0x00
echo -n 0x00
else
echo -n 0x01
# Check if npm is installed
if command -v npm &> /dev/null; then
if ! [[ "$(npm list -g huffc)" =~ "empty" ]]; then
# huffc was installed via npm, return 0x00
echo -n 0x00
exit 0
fi
fi

# Check if yarn is installed
if command -v yarn &> /dev/null; then
if [[ "$(yarn global list)" =~ "huffc" ]]; then
# huffc was installed via yarn, return 0x00
echo -n 0x00
exit 0
fi
fi

# Else, return 0x01
echo -n 0x01

0 comments on commit 103b179

Please sign in to comment.