-
Notifications
You must be signed in to change notification settings - Fork 20
Description
Commit cd7cd64 changed the creation of the source code tarball to use this definition of src_dir:
workflows/.github/workflows/release.yml
Line 81 in cd7cd64
| : "$(dirname "$grammar")"; : "${_/\./}"; src_dir="$_${_:+/}src" |
I am by no means a Bash expert, but what seems to be happening is:
-
$grammar(defined in an enclosingwhileloop) is passed todirnameand expanded in a string. The resulting string will usually—but not always—be the current folder.(because most Tree-sitter grammars have a grammar.js file in their top-level folder). In some grammars (like TypeScript), the resulting string will be a subfolder of the current folder (like./tsxor./typescript). -
The special Bash variable
_is expanded in a string using${parameter/pattern/string}expansion. The effect is to remove periods from the result of$(dirname "$grammar"). For grammars like TypeScript, the result is/tsxor/typescript(without leading periods). -
The variable
src_diris assigned the value formed by concatenating:- the Bash variable
_(which is now/tsxor/typescript) - the path separator
/(unless_is null or unset) src
- the Bash variable
The result is that, for grammars like TypeScript, src_dir is an absolute path (/tsx/src or /typescript/src). This causes the release action to fail for similarly-formed grammars:
https://github.com/nwhetsell/tree-sitter-lilypond/actions/runs/19333509263/job/55302233936#step:8:22
(The TypeScript grammar was last updated in Nov 2024, well before commit cd7cd64 (Aug 2025), so this issue hasn’t had an opportunity to occur there yet.)