Skip to content

Commit

Permalink
fix(cypress): drop unwanted docker output characters
Browse files Browse the repository at this point in the history
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
  • Loading branch information
skjnldsv committed Aug 22, 2024
1 parent 7c78acd commit 482035f
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions cypress/dockerNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,8 @@ export const configureNextcloud = async function() {
const hashing = await runExec(container, ['php', 'occ', 'config:system:get', 'hashing_default_password'])

console.log('├─ Checking APCu configuration... 👀')
if (!distributed.trim().includes('\\OC\\Memcache\\APCu')
|| !local.trim().includes('\\OC\\Memcache\\APCu')
if (!distributed.trim().includes('Memcache\\APCu')
|| !local.trim().includes('Memcache\\APCu')
|| !hashing.trim().includes('true')) {
console.log('└─ APCu is not properly configured 🛑')
throw new Error('APCu is not properly configured')
Expand Down Expand Up @@ -294,9 +294,14 @@ const runExec = async function(
if (stream) {
stream.setEncoding('utf-8')
stream.on('data', str => {
str = str.trim()
// Remove non printable characters
.replace(/[^\x20-\x7E]+/g, '')
// Remove non alphanumeric leading characters
.replace(/^[^a-z]/gi, '')
output += str
if (verbose && str.trim() !== '') {
console.log(`├─ ${str.trim().replace(/\n/gi, '\n├─ ')}`)
if (verbose && str !== '') {
console.log(`├─ ${str.replace(/\n/gi, '\n├─ ')}`)
}
})
stream.on('end', () => resolve(output))
Expand Down

0 comments on commit 482035f

Please sign in to comment.