Rename before running transform
This commit is contained in:
+1
-1
@@ -22,7 +22,7 @@
|
|||||||
"changecase-src": "node tasks/filename-case-from-module.js",
|
"changecase-src": "node tasks/filename-case-from-module.js",
|
||||||
"transform-examples": "jscodeshift --transform transforms/module.js examples",
|
"transform-examples": "jscodeshift --transform transforms/module.js examples",
|
||||||
"transform-test": "jscodeshift --transform transforms/module.js test",
|
"transform-test": "jscodeshift --transform transforms/module.js test",
|
||||||
"transform": "npm run transform-src && npm run changecase-src && npm run transform-examples && npm run transform-test && npm run lint -- --fix"
|
"transform": "npm run changecase-src && npm run transform-src && npm run transform-examples && npm run transform-test && npm run lint -- --fix"
|
||||||
},
|
},
|
||||||
"main": "dist/ol.js",
|
"main": "dist/ol.js",
|
||||||
"repository": {
|
"repository": {
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ glob('src/**/*.js', {}, function(err, files) {
|
|||||||
const lines = contents.split('\n');
|
const lines = contents.split('\n');
|
||||||
for (let i = lines.length - 1; i >= 0; --i) {
|
for (let i = lines.length - 1; i >= 0; --i) {
|
||||||
const line = lines[i];
|
const line = lines[i];
|
||||||
const match = line.match(/export default _.*_([^;]*)_;$/);
|
const match = line.match(/goog\.provide\('.*\.([^']*)'\);$/);
|
||||||
if (match && match.length) {
|
if (match && match.length) {
|
||||||
const newName = match[1] + '.js';
|
const newName = match[1] + '.js';
|
||||||
if (newName != newName.toLowerCase()) {
|
if (newName != newName.toLowerCase()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user