-
Notifications
You must be signed in to change notification settings - Fork 156
pre-requisite dependency(node or yarn) version check added in dev.sh file #589
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
80d7173
fd52d84
a9b5758
bfc13c1
13e9c36
be18b21
b1e474c
62654bf
47c56d4
90602fc
e54b5e9
bd47e45
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,46 @@ | ||
| #!/bin/bash | ||
|
|
||
| REQUIRED_NODE_VERSION=22.9.0 | ||
| REQUIRED_YARN_VERSION=1.22.22 | ||
|
|
||
| version_ge() { | ||
|
||
| [ "$(printf '%s\n' "$@" | sort -V | head -n 1)" == "$1" ] | ||
| } | ||
|
|
||
| # Check Node.js version | ||
| check_node_version() { | ||
| if ! command -v node &> /dev/null; then | ||
| echo "Node.js is not installed. Please install Node.js v$REQUIRED_NODE_VERSION or higher." | ||
| exit 1 | ||
| fi | ||
|
|
||
| NODE_VERSION=$(node -v | sed 's/v//') | ||
| if ! version_ge "$NODE_VERSION" "$REQUIRED_NODE_VERSION"; then | ||
| echo "Current Node.js version ($NODE_VERSION) is incompatible. Please install v$REQUIRED_NODE_VERSION or higher." | ||
| exit 1 | ||
| fi | ||
| } | ||
|
|
||
| # Check Yarn version | ||
| check_yarn_version() { | ||
| if ! command -v yarn &> /dev/null; then | ||
| echo "Yarn is not installed. Please install Yarn v$REQUIRED_YARN_VERSION or higher." | ||
| exit 1 | ||
| fi | ||
|
|
||
| YARN_VERSION=$(yarn -v) | ||
| if ! version_ge "$YARN_VERSION" "$REQUIRED_YARN_VERSION"; then | ||
| echo "Current Yarn version ($YARN_VERSION) is incompatible. Please install v$REQUIRED_YARN_VERSION or higher." | ||
| exit 1 | ||
| fi | ||
| } | ||
|
|
||
| check_node_version | ||
| check_yarn_version | ||
|
|
||
| echo "Node.js and Yarn versions are compatible. Proceeding..." | ||
|
|
||
|
|
||
| [ ! -f .env ] && cp env.example .env | ||
|
|
||
| check_internet_connection() { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we're not strict on Node 22.9. It can be anything above 22 (for now).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yarn does need to be 1.22.22 at least.