Skip to content

Commit

Permalink
feat: add ability to override wasm_file (#46)
Browse files Browse the repository at this point in the history
* feat: add ability to override `wasm_file`

* fix: renamed wasm_file to fish_wasm_file in ./scripts/build-fish-wasm.fish

---------

Co-authored-by: ndonfris <ndonfris29@gmail.com>
  • Loading branch information
petertriho and ndonfris authored Jul 27, 2024
1 parent 24cb2ab commit 2615262
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions scripts/build-fish-wasm.fish
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#!/usr/bin/env fish

set -l wasm_file "$(find node_modules -type f -a -name tree-sitter-fish.wasm)"
# fish_wasm_file is only used in the nixos build step, and should otherwise be ignored
not set -q fish_wasm_file; and set -l fish_wasm_file "$(find node_modules -type f -a -name tree-sitter-fish.wasm)"

if test -z "$wasm_file"
if test -z "$fish_wasm_file"
yarn add @esdmr/tree-sitter-fish
echo "ERROR: 'tree-sitter-fish.wasm' not found"
echo -e "try installing:\t@esdmr/tree-sitter-fish"
Expand All @@ -13,5 +14,5 @@ if test -z "$wasm_file"
exit 1
end

cp -f "$wasm_file" .
and echo "SUCCESS: tree-sitter-fish.wasm copied"
cp -f "$fish_wasm_file" .
and echo "SUCCESS: tree-sitter-fish.wasm copied from location '$fish_wasm_file'"

0 comments on commit 2615262

Please sign in to comment.