Skip to content

Instantly share code, notes, and snippets.

@idkjs
Created July 5, 2021 19:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save idkjs/b1a9e65c8c3759918f495af7bdeab658 to your computer and use it in GitHub Desktop.
Save idkjs/b1a9e65c8c3759918f495af7bdeab658 to your computer and use it in GitHub Desktop.
#!/bin/sh
# cd ..
files=$(find src -name "*.re" && find src -name "*.rei")
echo $files
for file in $files
do
echo $PWD/$file
# fastreplacestring $file "ReasonReact.NoUpdate" "NoUpdate"
fastreplacestring $file "ReasonReact.Update" "Update"
fastreplacestring $file "ReasonReact.UpdateWithSideEffects" "UpdateWithSideEffects"
fastreplacestring $file "ReactEventRe.Synthetic" "ReactEvent.Synthetic"
fastreplacestring $file "ReactEventRe" "ReactEvent"
fastreplacestring $file "Js.Null_undefined.to_opt" "Js.Nullable.toOption"
fastreplacestring $file "Js.Nullable.to_opt" "Js.Nullable.toOption"
fastreplacestring $file "Js.Null_undefined.to_opt" "Js.Nullable.toOption"
fastreplacestring $file "ReactEventRe.Mouse.stopPropagation" "ReactEvent.Mouse.stopPropagation"
fastreplacestring $file "ReasonReact.nullElement" "React.null"
fastreplacestring $file "ReasonReact.stringToElement" "React.string"
fastreplacestring $file "ReasonReact.string" "React.string"
fastreplacestring $file "ReasonReact.arrayToElement" "React.array"
fastreplacestring $file "ReasonReact.array" "React.array"
fastreplacestring $file "ReasonReact.reactElement" "React.element"
fastreplacestring $file "ReasonReact.NoUpdate" "NoUpdate"
fastreplacestring $file "Js.boolean" "bool"
fastreplacestring $file "Js.false_" "false"
fastreplacestring $file "Js.true_" "true"
done
#!/bin/sh
# cd ..
files=$(find src -name "*.re" && find src -name "*.rei")
echo $files
for file in $files
do
echo $PWD/$file
fastreplacestring $file "React.nullElement" "React.null"
done
@idkjs
Copy link
Author

idkjs commented Jul 5, 2021

The first script works but segfaults, whatever that means, when you include "React.nullElement" "React.null" in its so two scripts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment