-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extract local path logic and add tests. (#341)
* Extract local path logic and add tests. * Add appveyor to run test on Windows. * Fix weird race issues. - Always pass call callback function on generate. - Previously tests were randomly failing when running few times in a row. * Windows will scandir for template. * Add missing dev dependencies. * Node v4 will get npm v2 which fails on windows. - update readme
- Loading branch information
Showing
8 changed files
with
72 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
environment: | ||
matrix: | ||
- nodejs_version: "5" | ||
- nodejs_version: "6" | ||
|
||
install: | ||
- ps: Install-Product node $env:nodejs_version | ||
- npm install | ||
|
||
test_script: | ||
- node --version | ||
- npm --version | ||
- npm test | ||
|
||
cache: | ||
- node_modules -> yarn.lock | ||
|
||
build: off |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
var path = require('path') | ||
|
||
module.exports = { | ||
isLocalPath: function (templatePath) { | ||
return /^[./]|(^[a-zA-Z]:)/.test(templatePath) | ||
}, | ||
|
||
getTemplatePath: function (templatePath) { | ||
return path.isAbsolute(templatePath) | ||
? templatePath | ||
: path.normalize(path.join(process.cwd(), templatePath)) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -747,7 +747,7 @@ babel-preset-latest@^6.16.0: | |
babel-preset-es2016 "^6.22.0" | ||
babel-preset-es2017 "^6.22.0" | ||
|
||
babel-preset-stage-2@^6.18.0: | ||
babel-preset-stage-2@^6.18.0, babel-preset-stage-2@^6.22.0: | ||
version "6.22.0" | ||
resolved "https://registry.npmjs.org/babel-preset-stage-2/-/babel-preset-stage-2-6.22.0.tgz#ccd565f19c245cade394b21216df704a73b27c07" | ||
dependencies: | ||
|
@@ -3516,18 +3516,14 @@ [email protected]: | |
dependencies: | ||
brace-expansion "^1.0.0" | ||
|
||
[email protected]: | ||
[email protected], minimist@~0.0.1: | ||
version "0.0.8" | ||
resolved "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" | ||
|
||
minimist@^1.1.0, minimist@^1.2.0: | ||
version "1.2.0" | ||
resolved "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" | ||
|
||
minimist@~0.0.1: | ||
version "0.0.10" | ||
resolved "https://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz#de3f98543dbf96082be48ad1a0c7cda836301dcf" | ||
|
||
[email protected]: | ||
version "0.3.0" | ||
resolved "https://registry.npmjs.org/mkdirp/-/mkdirp-0.3.0.tgz#1bbf5ab1ba827af23575143490426455f481fe1e" | ||
|
This does not work on Node 4, since it doesn't support destructuring.