Skip to content

Commit

Permalink
chore: Fix create-module and promote-module (#660)
Browse files Browse the repository at this point in the history
* chore: Fix create-module and promote-module
  • Loading branch information
NicholasBoll committed May 19, 2020
1 parent 370c732 commit 25ebd14
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion utils/create-component/createComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ inquirer
const componentPath = path.join(cwd, unstable ? `modules/_labs/${name}` : `modules/${name}`);

if (!fs.existsSync(componentPath)) {
mkdirp(componentPath);
mkdirp.sync(componentPath);
}

css && createModule(componentPath, 'css', createCssModule, answers);
Expand Down
2 changes: 1 addition & 1 deletion utils/create-component/createCssModule.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ module.exports = (modulePath, name, description, unstable) => {

console.log('\nCreating '.underline + `${moduleName}\n`.blue.underline);

mkdirp(modulePath);
mkdirp.sync(modulePath);

const titleCaseName = getTitleCaseName(name);
const storyPath = unstable ? `Labs/CSS/${titleCaseName}` : `CSS/${titleCaseName}`;
Expand Down
2 changes: 1 addition & 1 deletion utils/create-component/createReactModule.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ module.exports = (modulePath, name, description, unstable) => {

console.log('\nCreating ' + `${moduleName}\n`.blue.underline);

mkdirp(modulePath);
mkdirp.sync(modulePath);

const pascalCaseName = getPascalCaseName(name);
const titleCaseName = getTitleCaseName(name);
Expand Down
4 changes: 1 addition & 3 deletions utils/create-component/writeModuleFiles.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@ module.exports = (files, modulePath) => {

console.log('Creating ' + `.${filePath.replace(cwd, '')}`.cyan);

mkdirp(getDirName(filePath), function(err) {
if (err) return cb(err);

mkdirp(getDirName(filePath)).then(() => {
fs.writeFileSync(filePath, file.contents);
});
});
Expand Down
2 changes: 1 addition & 1 deletion utils/css-build.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const postcssConfig = require('../.postcssrc.js');
const nodeModules = path.resolve(__dirname, '../node_modules');

// Make the build directory if it doesn't exist
mkdirp(outputDir);
mkdirp.sync(outputDir);

const postcssPlugins = Object.keys(postcssConfig.plugins).map(plugin => {
const name = plugin;
Expand Down
2 changes: 1 addition & 1 deletion utils/js-build.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const outputDir = path.join(cwd, 'dist');
const outputFile = path.join(outputDir, path.basename(sourceFile));

// Make the build directory if it doesn't exist
mkdirp(outputDir);
mkdirp.sync(outputDir);

// Standard bundle
const inputOptions = {
Expand Down
2 changes: 1 addition & 1 deletion utils/promote-component.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ inquirer.prompt(questions).then(answers => {
const destPath = path.join(cwd, `modules/${component}`);

if (!fs.existsSync(destPath)) {
mkdirp(destPath);
mkdirp.sync(destPath);
}

if (fs.existsSync(`${destPath}/${target}`)) {
Expand Down

0 comments on commit 25ebd14

Please sign in to comment.