This repository has been archived by the owner on Sep 9, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
updated script for people who dont have npm or yarn installed
- Loading branch information
1 parent
c4ba155
commit 103b179
Showing
1 changed file
with
19 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |