Skip to content

Commit

Permalink
stash
Browse files Browse the repository at this point in the history
  • Loading branch information
jvalkeal committed Sep 22, 2024
1 parent 367e6d2 commit d5db6fa
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 10 deletions.
4 changes: 2 additions & 2 deletions .github/actions/update-ts-languages/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ runs:
- name: Update TS Languages
shell: bash
run: |
./scripts/generate-ts.sh -jz
./scripts/generate-languages.sh -jz
./src/scripts/generate-ts.sh -jz
./src/scripts/generate-ts-languages.sh -jz
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
#!/bin/bash

find_basedir() {
local basedir=$(cd -P -- "$(dirname -- "$0")" && cd .. && pwd -P)
local basedir=$(cd -P -- "$(dirname -- "$0")" && cd .. && cd .. && pwd -P)
echo "${basedir}"
}

PROJECTBASEDIR=$(find_basedir)

dojextract='false'
dozig='false'

print_usage() {
echo "Usage: generate-languages.sh [-j] [-z]"
echo "Usage: generate-ts-languages.sh [-j] [-z]"
}

while getopts 'jz' flag; do
Expand Down Expand Up @@ -52,8 +54,6 @@ tree-sitter-grammars,tree-sitter-yaml,v0.6.1,yaml
# tree-sitter-grammars,tree-sitter-xml,v0.6.4,xml
# tree-sitter-grammars,tree-sitter-lua,v0.1.0,lua

export PROJECTBASEDIR=$(find_basedir)

for VALUE in $VALUES;
do
GHOWNER=$(echo $VALUE | cut -f1 -d,)
Expand All @@ -62,11 +62,12 @@ for VALUE in $VALUES;
LANGUAGEID=$(echo $VALUE | cut -f4 -d,)
LANGUAGENAME="${LANGUAGEID^}"
REPOPATH=$TMPDIR/$GHOWNER/$GHREPO
TARGETMODULEPATH=spring-shell-treesitter-languages/spring-shell-treesitter-language-$LANGUAGEID
TARGETMODULEPATH=$PROJECTBASEDIR/spring-shell-treesitter-languages/spring-shell-treesitter-language-$LANGUAGEID
git clone --depth 1 -b $TAG https://github.com/$GHOWNER/$GHREPO.git $REPOPATH

if [ "$dojextract" == "true" ]; then
npx hygen init tslanguage --language $LANGUAGEID
(cd $PROJECTBASEDIR; HYGEN_TMPLS=$PROJECTBASEDIR/src/hygen npx hygen init tslanguage --language $LANGUAGEID)
# npx hygen init tslanguage --language $LANGUAGEID
mkdir -p $TARGETMODULEPATH/src/ts
cp $REPOPATH/bindings/c/tree-sitter-$LANGUAGEID.h $TARGETMODULEPATH/src/ts/
mkdir -p $TARGETMODULEPATH/src/main/resources/org/springframework/shell/treesitter/queries/$LANGUAGEID
Expand Down
6 changes: 4 additions & 2 deletions scripts/generate-ts.sh → src/scripts/generate-ts.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
#!/bin/bash

find_basedir() {
local basedir=$(cd -P -- "$(dirname -- "$0")" && cd .. && pwd -P)
local basedir=$(cd -P -- "$(dirname -- "$0")" && cd .. && cd .. && pwd -P)
echo "${basedir}"
}

PROJECTBASEDIR=$(find_basedir)

dojextract='false'
dozig='false'

Expand All @@ -28,7 +30,7 @@ GHOWNER=tree-sitter
GHREPO=tree-sitter
TAG=v0.23.0
REPOPATH=$TMPDIR/$GHOWNER/$GHREPO
TARGETMODULEPATH=spring-shell-treesitter
TARGETMODULEPATH=$PROJECTBASEDIR/spring-shell-treesitter

git clone --depth 1 -b $TAG https://github.com/$GHOWNER/$GHREPO.git $REPOPATH
mkdir -p $TARGETMODULEPATH/src/ts
Expand Down

0 comments on commit d5db6fa

Please sign in to comment.