mirror of
https://github.com/cypress-io/cypress.git
synced 2026-04-22 23:20:24 -05:00
eab801ae3f
* chore(deps): Update eslint to 6.8.0 🌟 * fix missing dangling commas for linter * fix missing dangling commas for linter * more lint fixes * yarn lock Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com> Co-authored-by: Jennifer Shehane <shehane.jennifer@gmail.com>
27 lines
607 B
JavaScript
27 lines
607 B
JavaScript
const fs = require('fs-extra')
|
|
const glob = require('glob')
|
|
const Promise = require('bluebird')
|
|
|
|
const globAsync = Promise.promisify(glob)
|
|
|
|
const endingNewLines = /\s+$/g
|
|
const contentBetweenBackticksRe = /\`([\s\S]+?)\`/g
|
|
|
|
globAsync('packages/server/__snapshots__/*')
|
|
.map((file) => {
|
|
return fs.readFile(file, 'utf8')
|
|
.then((str) => {
|
|
return str
|
|
.replace(
|
|
contentBetweenBackticksRe,
|
|
'`\n$1\n`',
|
|
)
|
|
.split('`\n\n\n').join('`\n\n')
|
|
.split('\n\n\n\n`').join('\n\n\n`')
|
|
.split(endingNewLines).join('\n')
|
|
})
|
|
.then((str) => {
|
|
return fs.writeFile(file, str)
|
|
})
|
|
})
|