-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathmodule-fix.sh
More file actions
executable file
·6 lines (6 loc) · 1004 Bytes
/
module-fix.sh
File metadata and controls
executable file
·6 lines (6 loc) · 1004 Bytes
1
2
3
4
5
6
#!/bin/sh
find ./Content/Datas/Scripts/System \( -type d -name .git -prune \) -o -type f -print0 | xargs -0 sed -i -E 's/export \* from "(.+)"/export \* from "\1\.js"/g'
find ./Content/Datas/Scripts/System \( -type d -name .git -prune \) -o -type f -print0 | xargs -0 sed -i -E 's/export \* as (.+) from "(.+)"/export \* as \1 from "\.\/\1\/index\.js"/g'
find ./Content/Datas/Scripts/System \( -type d -name .git -prune \) -o -type f -print0 | xargs -0 sed -i -E 's/import (\{ .+ \}|\* as .+) from "(\.\.?\/)(.+)"/import \1 from "\2\3\.js"/g'
find ./Content/Datas/Scripts/System \( -type d -name .git -prune \) -o -type f -print0 | xargs -0 sed -i -E 's/import (\{ .+ \}|\* as .+) from "(\.\.?\/?\.?\.?\/)(Graphic|Core|Datas|EventCommand|Manager|Scene|Common|System|Libs|Utils).js"/import \1 from "\2\3\/index\.js"/g'
find ./Content/Datas/Scripts/System \( -type d -name .git -prune \) -o -type f -print0 | xargs -0 sed -i -E 's/import (\{ .+ \}|\* as .+) from "(\.\.?)"/import \1 from "\2\/index\.js"/g'