Skip to content

Commit

Permalink
fix: support more local folder variants
Browse files Browse the repository at this point in the history
  • Loading branch information
3cp committed Apr 23, 2019
1 parent 069db50 commit 7080beb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/skeleton-dir.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ module.exports = async function(supplier, {
_tmpFolder
} = {}) {
// local folder
if (supplier.startsWith('.') || supplier.startsWith('~')) {
if (supplier.match(/^(\.|\/|\\|[a-z]:)/i)) {
if (isDir(supplier)) {
info('Using local skeleton ' + supplier);
return supplier;
Expand Down
2 changes: 2 additions & 0 deletions test/skeleton-dir.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@ test.serial('skeletonDir simply returns local dir', async t => {
mockfs({
'../my/dir/.keep': '',
'./my/dir/.keep': '',
'/my/dir/.keep': ''
});
t.is(await skeletonDir('../my/dir'), '../my/dir');
t.is(await skeletonDir('./my/dir'), './my/dir');
t.is(await skeletonDir('/my/dir'), '/my/dir');
});

test.serial('skeletonDir complains about missing local dir', async t => {
Expand Down

0 comments on commit 7080beb

Please sign in to comment.