-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
38b08e0
commit 4245348
Showing
15 changed files
with
369 additions
and
46 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 |
---|---|---|
|
@@ -5,6 +5,9 @@ os: | |
language: node_js | ||
node_js: | ||
- node | ||
- '13' | ||
- '12' | ||
- '11' | ||
- '10' | ||
- '9' | ||
- '8' | ||
|
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 @@ | ||
'use strict'; | ||
|
||
const fs = require('fs'); | ||
const path = require('path'); | ||
const gitignore = require('..'); | ||
|
||
const filepath = path.join(__dirname, '../test/fixtures/_gitignore'); | ||
const contents = fs.readFileSync(filepath, 'utf8'); | ||
|
||
// console.log(gitignore.parse(contents)); | ||
// console.log(contents.trim() === gitignore.dedupe(contents).trim()); | ||
const deduped = gitignore.dedupe(contents); | ||
console.log(deduped); |
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,7 @@ | ||
const fs = require('fs'); | ||
const path = require('path'); | ||
const gitignore = require('..'); | ||
|
||
const filepath = path.join(__dirname, '../test/fixtures/_gitignore'); | ||
|
||
console.log(gitignore(fs.readFileSync(filepath))); |
This file was deleted.
Oops, something went wrong.
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,20 @@ | ||
'use strict'; | ||
|
||
const start = Date.now(); | ||
process.on('exit', () => console.error(`Total: ${Date.now() - start}ms`)); | ||
|
||
const fs = require('fs'); | ||
const path = require('path'); | ||
const glob = require('glob'); | ||
const parse = require('..'); | ||
const files = []; | ||
|
||
const ignore = parse(fs.readFileSync(path.join(__dirname, '../test/fixtures/_gitignore'))); | ||
|
||
glob('*', { ignore, cwd: __dirname }, (err, files) => { | ||
if (err) { | ||
console.log(err); | ||
} else { | ||
console.log(files); | ||
} | ||
}); |
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 |
---|---|---|
@@ -1,4 +1,7 @@ | ||
const fs = require('fs'); | ||
const path = require('path'); | ||
const parse = require('..'); | ||
console.log(parse(fs.readFileSync(path.join(__dirname, '_gitignore')))); | ||
const gitignore = require('..'); | ||
|
||
const filepath = path.join(__dirname, '../test/fixtures/_gitignore'); | ||
|
||
console.log(JSON.stringify(gitignore.parse(fs.readFileSync(filepath)), null, 2)); |
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,11 @@ | ||
'use strict'; | ||
|
||
const fs = require('fs'); | ||
const path = require('path'); | ||
const gitignore = require('..'); | ||
|
||
const filepath = path.join(__dirname, '../.gitignore'); | ||
const parsed = gitignore.parse(filepath); | ||
|
||
console.log(parsed); | ||
console.log(gitignore.stringify(parsed.sections)); |
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 |
---|---|---|
@@ -1,6 +1,13 @@ | ||
const parse = require('..'); | ||
const str = fs.readFileSync('.gitignore', 'utf8'); | ||
const res = parse(str); | ||
'use strict'; | ||
|
||
const fs = require('fs'); | ||
const path = require('path'); | ||
const gitignore = require('..'); | ||
|
||
const filepath = path.join(__dirname, '../.gitignore'); | ||
const contents = fs.readFileSync(filepath); | ||
|
||
const res = gitignore.parse(contents); | ||
|
||
console.log(res); | ||
console.log(stringify(res.sections)); | ||
console.log(gitignore.stringify(res.sections)); |
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
Oops, something went wrong.