Skip to content

Commit

Permalink
REMOVE THIS COMMIT
Browse files Browse the repository at this point in the history
  • Loading branch information
Luni-4 committed Apr 12, 2021
1 parent e8df35f commit 53ce789
Showing 1 changed file with 50 additions and 48 deletions.
98 changes: 50 additions & 48 deletions check-grammars-crates.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,54 +3,56 @@
# Stop at the first error
set -e

# Get all tree-sitter crates from the analyzed branch Cargo.toml
TS_CRATES=`grep "tree-sitter-*" Cargo.toml | tr -d ' '`

# Disable/Enable CI flag
RUN_CI="no"

# Temporary master branch Cargo.toml filename
MASTER_CARGO_TOML="master-cargo.toml"

# Download master branch Cargo.toml and save it in a temporary file
wget -LqO - https://raw.githubusercontent.com/mozilla/rust-code-analysis/master/Cargo.toml | tr -d ' ' > $MASTER_CARGO_TOML

# For each tree-sitter crate from the analyzed branch Cargo.toml
for TS_CRATE in $TS_CRATES
do
# Get the name of the current crate
TS_CRATE_NAME=`echo $TS_CRATE | cut -f1 -d "="`

# Get the crate name from the master branch Cargo.toml
MASTER_TS_CRATE_NAME=`grep $TS_CRATE_NAME $MASTER_CARGO_TOML | head -n 1 | cut -f1 -d "="`

# If the current crate name is not present in master branch, skip to the next crate
if [ -z "$MASTER_TS_CRATE_NAME" ]
then
continue
fi

# Get the same crate from the master branch Cargo.toml
MASTER_TS_CRATE=`grep $TS_CRATE $MASTER_CARGO_TOML | head -n 1`

# If the current crate has been updated, save the crate name and break the loop
if [ -z "$MASTER_TS_CRATE" ]
then
# Enable CI flag
RUN_CI="yes"
# Name of tree-sitter crate
TREE_SITTER_CRATE=$TS_CRATE_NAME
break
fi
done

# Remove temporary master branch Cargo.toml file
rm -rf $MASTER_CARGO_TOML

# If any crates have been updated, exit the script
if [ "$RUN_CI" = "no" ]; then
exit 0
fi
## Get all tree-sitter crates from the analyzed branch Cargo.toml
#TS_CRATES=`grep "tree-sitter-*" Cargo.toml | tr -d ' '`
#
## Disable/Enable CI flag
#RUN_CI="no"
#
## Temporary master branch Cargo.toml filename
#MASTER_CARGO_TOML="master-cargo.toml"
#
## Download master branch Cargo.toml and save it in a temporary file
#wget -LqO - https://raw.githubusercontent.com/mozilla/rust-code-analysis/master/Cargo.toml | tr -d ' ' > $MASTER_CARGO_TOML
#
## For each tree-sitter crate from the analyzed branch Cargo.toml
#for TS_CRATE in $TS_CRATES
#do
# # Get the name of the current crate
# TS_CRATE_NAME=`echo $TS_CRATE | cut -f1 -d "="`
#
# # Get the crate name from the master branch Cargo.toml
# MASTER_TS_CRATE_NAME=`grep $TS_CRATE_NAME $MASTER_CARGO_TOML | head -n 1 | cut -f1 -d "="`
#
# # If the current crate name is not present in master branch, skip to the next crate
# if [ -z "$MASTER_TS_CRATE_NAME" ]
# then
# continue
# fi
#
# # Get the same crate from the master branch Cargo.toml
# MASTER_TS_CRATE=`grep $TS_CRATE $MASTER_CARGO_TOML | head -n 1`
#
# # If the current crate has been updated, save the crate name and break the loop
# if [ -z "$MASTER_TS_CRATE" ]
# then
# # Enable CI flag
# RUN_CI="yes"
# # Name of tree-sitter crate
# TREE_SITTER_CRATE=$TS_CRATE_NAME
# break
# fi
#done
#
## Remove temporary master branch Cargo.toml file
#rm -rf $MASTER_CARGO_TOML
#
## If any crates have been updated, exit the script
#if [ "$RUN_CI" = "no" ]; then
# exit 0
#fi

TREE_SITTER_CRATE="tree-sitter-javascript"

# Install json minimal tests
JMT_LINK="https://github.com/Luni-4/json-minimal-tests/releases/download"
Expand Down

0 comments on commit 53ce789

Please sign in to comment.