-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfix-all-imports.sh
More file actions
16 lines (11 loc) · 824 Bytes
/
fix-all-imports.sh
File metadata and controls
16 lines (11 loc) · 824 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/bash
echo "🔧 Fixing all .js import extensions..."
# Fix import statements ending with .js
find /workspaces/UPCODE/app -name "*.js" -type f -exec sed -i "s/from ['\"]\\([^'\"]*\\)\\.js['\"]/from '\\1'/g" {} +
find /workspaces/UPCODE/lib -name "*.js" -type f -exec sed -i "s/from ['\"]\\([^'\"]*\\)\\.js['\"]/from '\\1'/g" {} +
find /workspaces/UPCODE/components -name "*.js" -type f -exec sed -i "s/from ['\"]\\([^'\"]*\\)\\.js['\"]/from '\\1'/g" {} +
# Fix import statements with semicolons
find /workspaces/UPCODE/app -name "*.js" -type f -exec sed -i "s/from ['\"]\\([^'\"]*\\)\\.js['\"]/from '\\1'/g" {} +
# Fix require statements as well
find /workspaces/UPCODE/app -name "*.js" -type f -exec sed -i "s/require(['\"]\\([^'\"]*\\)\\.js['\"]/require('\\1'/g" {} +
echo "✅ Fixed all .js import extensions"