Skip to content

Commit 396829b

Browse files
authored
Merge pull request #136 from bcomnes/fix-path-resolution
Correct path resolution when to/from paths match
2 parents 90d7136 + 5279151 commit 396829b

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/lib/paths.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ const getAssetsPath = (baseDir, assetsPath, relative) =>
5757
* @returns {String}
5858
*/
5959
const getTargetDir = (dir) =>
60-
dir.from !== dir.to ? dir.to : process.cwd();
60+
dir.to != null ? dir.to : process.cwd();
6161

6262
/**
6363
* Stylesheet file path from decl

test/lib/paths.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,10 @@ describe('paths', () => {
7474
);
7575
assert.equal(
7676
paths.getTargetDir({ from: '/project', to: '/project' }),
77+
'/project'
78+
);
79+
assert.equal(
80+
paths.getTargetDir({ from: '/project' }),
7781
process.cwd()
7882
);
7983
});

0 commit comments

Comments
 (0)