-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow skipping binary download during install (#1008)
* added CYPRESS_SKIP_BINARY_INSTALL env var check before installing * cli: provide reason binary installation is being skipped - more linting, why not * cli: prettify snapshots by removing whitespace at end of line
- Loading branch information
1 parent
da374e3
commit 3a53860
Showing
4 changed files
with
59 additions
and
16 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
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 |
---|---|---|
@@ -1,16 +1,22 @@ | ||
const stripAnsi = require('strip-ansi') | ||
|
||
const excessWhitespaceRe = /(\s{3,})/ | ||
const whitespaceAtEndOfLineRe = /\s+$/g | ||
const datesRe = /(\d+:\d+:\d+)/g | ||
const downloadQueryRe = /(\?platform=(darwin|linux|win32)&arch=(x64|ia32))/ | ||
|
||
const removeExcessWhiteSpace = (str) => { | ||
return str.replace(whitespaceAtEndOfLineRe, '') | ||
} | ||
|
||
module.exports = (str) => { | ||
// strip dates and ansi codes | ||
// and excess whitespace | ||
return stripAnsi( | ||
str | ||
.replace(datesRe, 'xx:xx:xx') | ||
.replace(excessWhitespaceRe, ' ') | ||
.split('\n') | ||
.map(removeExcessWhiteSpace) | ||
.join('\n') | ||
.replace(downloadQueryRe, '?platform=OS&arch=ARCH') | ||
) | ||
} |