Created
February 21, 2020 15:46
-
-
Save hcarty/16d8cecce11b390753dd76d4549a9686 to your computer and use it in GitHub Desktop.
Converting Reason to OCaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Use as: find . -name "*.re" -exec ./convert_re.sh {} \; | |
set -euf -o pipefail | |
src="$1" | |
dst="${src%.re}.ml" | |
echo Converting "$src" to "$dst" | |
refmt -p binary_reason "$src" | ocamlformat_reason --enable-outside-detected-project --disable-conf-files --impl -o "$dst" - | |
git add "$dst" | |
git rm "$src" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Use as: find . -name "*.rei" -exec ./convert_re.sh {} \; | |
set -euf -o pipefail | |
src="$1" | |
dst="${src%.rei}.mli" | |
echo Converting "$src" to "$dst" | |
refmt -p binary_reason "$src" | ocamlformat_reason --enable-outside-detected-project --disable-conf-files --intf -o "$dst" - | |
git add "$dst" | |
git rm "$src" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment