Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
arunmmanoharan committed Sep 20, 2020
2 parents cb0812d + a7b0c61 commit edc0aa7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
5 changes: 4 additions & 1 deletion .editorconfig
Expand Up @@ -10,4 +10,7 @@ trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false
trim_trailing_whitespace = false

[*.js]
quote_type = single
17 changes: 10 additions & 7 deletions tools/removeDemo.js
@@ -1,7 +1,7 @@
// This script removes demo app files
import rimraf from 'rimraf';
import fs from 'fs';
import {chalkSuccess} from './chalkConfig';
import { chalkSuccess } from './chalkConfig';

/* eslint-disable no-console */

Expand All @@ -17,21 +17,24 @@ const pathsToRemove = [
'./src/styles/*',
'./src/index.js',
'./src/types/*',
'./tools/removeDemo.js'
'./tools/removeDemo.js',
'./src/**/__snapshots__'
];

const filesToCreate = [
{
path: './src/components/emptyTest.spec.js',
content: '// Must have at least one test file in this directory or Mocha will throw an error.'
content:
'// Must have at least one test file in this directory or Mocha will throw an error.'
},
{
path: './src/index.js',
content: '// Set up your application entry point here...'
},
{
path: './src/reducers/index.js',
content: '// Set up your root reducer here...\n import { combineReducers } from \'redux\';\n export default combineReducers;'
content:
"// Set up your root reducer here...\n import { combineReducers } from 'redux';\n export default combineReducers;"
}
];

Expand All @@ -53,15 +56,15 @@ function removePackageJsonScriptEntry(scriptName) {
let fileData = fs.readFileSync(packageJsonPath);
let content = JSON.parse(fileData);
delete content.scripts[scriptName];
fs.writeFileSync(packageJsonPath,
JSON.stringify(content, null, 2) + '\n');
fs.writeFileSync(packageJsonPath, JSON.stringify(content, null, 2) + '\n');
}

let numPathsRemoved = 0;
pathsToRemove.map(path => {
removePath(path, () => {
numPathsRemoved++;
if (numPathsRemoved === pathsToRemove.length) { // All paths have been processed
if (numPathsRemoved === pathsToRemove.length) {
// All paths have been processed
// Now we can create files since we're done deleting.
filesToCreate.map(file => createFile(file));
}
Expand Down

0 comments on commit edc0aa7

Please sign in to comment.