Skip to content

Commit

Permalink
Merge pull request #136 from bcomnes/fix-path-resolution
Browse files Browse the repository at this point in the history
Correct path resolution when to/from paths match
  • Loading branch information
sergcen committed Sep 19, 2019
2 parents 90d7136 + 5279151 commit 396829b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/paths.js
Expand Up @@ -57,7 +57,7 @@ const getAssetsPath = (baseDir, assetsPath, relative) =>
* @returns {String}
*/
const getTargetDir = (dir) =>
dir.from !== dir.to ? dir.to : process.cwd();
dir.to != null ? dir.to : process.cwd();

/**
* Stylesheet file path from decl
Expand Down
4 changes: 4 additions & 0 deletions test/lib/paths.js
Expand Up @@ -74,6 +74,10 @@ describe('paths', () => {
);
assert.equal(
paths.getTargetDir({ from: '/project', to: '/project' }),
'/project'
);
assert.equal(
paths.getTargetDir({ from: '/project' }),
process.cwd()
);
});
Expand Down

0 comments on commit 396829b

Please sign in to comment.