Skip to content

Commit

Permalink
Merge pull request #5 from rocjs/fix/regression
Browse files Browse the repository at this point in the history
Fixes regression from 1.3.1
  • Loading branch information
andreasrs committed May 10, 2016
2 parents b9c9b23 + f4fca46 commit 3df15ef
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions config/roc.config.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
const readdirSync = require('fs').readdirSync;
const fileExists = require('roc').fileExists;
const fs = require('fs');
const roc = require('roc');

const folderExists = (path) => {
path = roc.getAbsolutePath(path);
try {
return fs.statSync(path).isDirectory();
} catch (error) {
return false;
}
};

const packages =
!fileExists(`${process.cwd()}/packages`) ? [] :
readdirSync(`${process.cwd()}/packages`)
!folderExists(`${process.cwd()}/packages`) ? [] :
fs.readdirSync(`${process.cwd()}/packages`)
.map((package) => {
if (fileExists(`${process.cwd()}/packages/${package}/package.json`)) {
if (roc.fileExists(`${process.cwd()}/packages/${package}/package.json`)) {
return {
folder: package,
path: `${process.cwd()}/packages/${package}`,
Expand Down

0 comments on commit 3df15ef

Please sign in to comment.