28 lines
538 B
Bash
Executable file
28 lines
538 B
Bash
Executable file
#!/bin/bash
|
|
|
|
root=$PWD
|
|
cd docs
|
|
|
|
bundle exec jekyll serve "$@" &
|
|
|
|
bundle exec ruby <<RUBY &
|
|
require "listen"
|
|
|
|
def copy_wasm_files
|
|
`cp $root/target/release/*.{js,wasm} $root/docs/assets/js/`
|
|
end
|
|
|
|
puts "Copying WASM files to docs folder..."
|
|
copy_wasm_files
|
|
|
|
puts "Watching release directory"
|
|
listener = Listen.to("$root/target/release", only: /^tree-sitter\.(js|wasm)$/, wait_for_delay: 2) do
|
|
puts "WASM files updated. Copying new files to docs folder..."
|
|
copy_wasm_files
|
|
end
|
|
|
|
listener.start
|
|
sleep
|
|
RUBY
|
|
|
|
wait
|