fix impatient not found on bootstrap
This commit is contained in:
parent
33c304f627
commit
074b656cbd
55 changed files with 17472 additions and 1 deletions
0
tree-sitter-lua/script/known_failures.txt
Normal file
0
tree-sitter-lua/script/known_failures.txt
Normal file
51
tree-sitter-lua/script/parse-examples
Executable file
51
tree-sitter-lua/script/parse-examples
Executable file
|
@ -0,0 +1,51 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
cd "$(dirname "${0}")/.."
|
||||
|
||||
checkout_repo() {
|
||||
local -r path="${1}"
|
||||
local -r repo="${2}"
|
||||
local -r sha="${3}"
|
||||
|
||||
echo "Checking out github.com/${repo}#${sha} in ${path}"
|
||||
|
||||
mkdir -p "${path}"
|
||||
pushd "${path}" >/dev/null
|
||||
|
||||
if [[ ! -d ".git" ]]; then
|
||||
git init --quiet
|
||||
git remote add origin "https://github.com/${repo}.git"
|
||||
git fetch --quiet --depth 1 origin "${sha}"
|
||||
elif [[ "${sha}" != "$(git rev-parse HEAD)" ]]; then
|
||||
git fetch --quiet --depth 1 origin "${sha}"
|
||||
fi
|
||||
|
||||
git checkout --quiet FETCH_HEAD
|
||||
|
||||
popd >/dev/null
|
||||
|
||||
echo
|
||||
}
|
||||
|
||||
checkout_repo "./examples/luvit" "luvit/luvit" "9841bc17aaab32fa63e11063cf68f82da615eefd"
|
||||
|
||||
parse_examples() {
|
||||
local -r known_failures="$(cat script/known_failures.txt)"
|
||||
|
||||
tree-sitter parse --quiet \
|
||||
"./examples/luvit/**/*.lua" \
|
||||
$(for file in ${known_failures}; do echo "!${file}"; done)
|
||||
|
||||
declare -r example_count=$(find ./examples -name "*.lua" | wc -l)
|
||||
declare -r failure_count=$(wc -w <<< "${known_failures}")
|
||||
declare -r success_count=$(( ${example_count} - ${failure_count} ))
|
||||
declare -r success_percent=$(bc -l <<< "100*${success_count}/${example_count}")
|
||||
|
||||
printf \
|
||||
"[Lua] Successfully parsed %d of %d example files (%.1f%%)\n" \
|
||||
${success_count} ${example_count} ${success_percent}
|
||||
}
|
||||
|
||||
parse_examples
|
33
tree-sitter-lua/script/release.sh
Executable file
33
tree-sitter-lua/script/release.sh
Executable file
|
@ -0,0 +1,33 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -eu
|
||||
|
||||
echo "Running Build..."
|
||||
npm run build
|
||||
echo
|
||||
|
||||
echo "Running Tests..."
|
||||
npm run test
|
||||
echo
|
||||
|
||||
echo "Bumping Version..."
|
||||
declare -r curr_version=$(npx -c 'echo $npm_package_version')
|
||||
npm version --allow-same-version --no-git-tag-version $@
|
||||
declare -r next_version=$(npx -c 'echo $npm_package_version')
|
||||
echo
|
||||
|
||||
if [[ "${curr_version}" = "${next_version}" ]]; then
|
||||
echo "Version did not change!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
git add package.json
|
||||
|
||||
echo "crate: tree-sitter-lua"
|
||||
echo "v${next_version}"
|
||||
cargo bump "${next_version}"
|
||||
git add "Cargo.toml"
|
||||
echo
|
||||
|
||||
git commit -m "chore: release v${next_version}"
|
||||
git tag "v${next_version}" -m "v${next_version}"
|
Loading…
Add table
Add a link
Reference in a new issue