From 97e355dedd894ac8df36e66d63ebebdaa22b6009 Mon Sep 17 00:00:00 2001 From: Jason Park Date: Sun, 9 Jun 2019 23:42:06 +0900 Subject: [PATCH] Remove a temporary file used to mass rename --- renamer.js | 15 --------------- 1 file changed, 15 deletions(-) delete mode 100644 renamer.js diff --git a/renamer.js b/renamer.js deleted file mode 100644 index 29bd469..0000000 --- a/renamer.js +++ /dev/null @@ -1,15 +0,0 @@ -const fs = require('fs'); -const path = require('path'); - -const componentsDir = path.resolve(__dirname, 'src', 'core', 'renderers'); - -const components = fs.readdirSync(componentsDir); -for (const component of components) { - if (!fs.statSync(path.resolve(componentsDir, component)).isDirectory()) continue; - const newJs = path.resolve(componentsDir, component, 'index.js'); - fs.renameSync(path.resolve(componentsDir, component, 'index.jsx'), newJs); - const content = fs.readFileSync(newJs, { encoding: 'utf8' }); - fs.writeFileSync(newJs, content.replace('stylesheet.module.scss', `${component}.module.scss`), { encoding: 'utf8' }); - if (fs.existsSync(path.resolve(componentsDir, component, 'stylesheet.module.scss'))) fs.renameSync(path.resolve(componentsDir, component, 'stylesheet.module.scss'), path.resolve(componentsDir, component, `${component}.module.scss`)); -} -console.log(components); -- GitLab