-
-
Notifications
You must be signed in to change notification settings - Fork 283
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: allow square brackets in path (#264)
* fix #231 allow brackets in path * only need take care of [ * use character sets to escape special character to avoid issue on Windows * [fix 220] create special directory/file through scripts * rm helpers directory on every test * add new line to the end of scripts * update code, add tests
- Loading branch information
1 parent
c779a30
commit 3ef5b6c
Showing
9 changed files
with
78 additions
and
15 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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 @@ | ||
const mkdirp = require('mkdirp'); | ||
const path = require('path'); | ||
const fs = require('fs'); | ||
const removeIllegalCharacterForWindows = require('../tests/utils/removeIllegalCharacterForWindows'); | ||
|
||
const baseDir = 'compiled_tests/helpers'; | ||
|
||
const specialFiles = { | ||
'[special?directory]/nested/nestedfile.txt': '', | ||
'[special?directory]/(special-*file).txt': 'special', | ||
'[special?directory]/directoryfile.txt': 'new' | ||
}; | ||
|
||
Object.keys(specialFiles).forEach(function (originFile) { | ||
const file = removeIllegalCharacterForWindows(originFile); | ||
const dir = path.dirname(file); | ||
mkdirp.sync(path.join(baseDir, dir)); | ||
fs.writeFileSync(path.join(baseDir, file), specialFiles[originFile]); | ||
}); | ||
|
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
File renamed without changes.
This file was deleted.
Oops, something went wrong.
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
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,4 @@ | ||
module.exports = function (string) { | ||
return process.platform !== 'win32' ? string : string.replace(/[*?"<>|]/g, ''); | ||
}; | ||
|