mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
ba7d11d854
[web] ES module helper scripts GitOrigin-RevId: ebbb123b6e7336215038156b83e96ad42869bb07
20 lines
395 B
Bash
Executable file
20 lines
395 B
Bash
Executable file
#!/bin/bash
|
|
|
|
if [ -z "$1" ]; then
|
|
echo "Usage: transform-dir.sh <module_path>"
|
|
exit 1
|
|
fi
|
|
|
|
MODULE_PATH=$1
|
|
|
|
while true; do
|
|
FILES=$(node scripts/esm-check-migration.mjs -f "$MODULE_PATH" -j | jq -r '.filesNotImportedViaCjs | join(" ")')
|
|
if [ -z "$FILES" ]; then
|
|
break
|
|
fi
|
|
node transform/cjs-to-esm/cjs-to-esm.mjs $FILES
|
|
done
|
|
|
|
make format_fix > /dev/null
|
|
|
|
echo "All files processed."
|