Skip to content

Commit

Permalink
fix: 'copy app image for e2e' script
Browse files Browse the repository at this point in the history
  • Loading branch information
EmiM committed Mar 19, 2024
1 parent 6e82f71 commit 5f80ac1
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions packages/e2e-tests/scripts/copyAppImage.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
// Copy built AppImage to Quiet directory and set the version in .env file
const { execSync } = require('child_process')
const { execFileSync } = require('child_process')
const path = require('path')
const fs = require('fs')

const desktop = path.join(__dirname, '..', '..', 'desktop')
const e2e = path.join(__dirname, '..')
const appVersion = JSON.parse(require('fs').readFileSync(path.join(desktop, 'package.json'), 'utf8')).version
const fileName = `Quiet-${appVersion}.AppImage`

execSync(`rm -rf ${path.join(desktop, 'dist', 'squashfs-root')}`)
execFileSync('rm', ['-rf', path.join(desktop, 'dist', 'squashfs-root')])

console.log(`Copying file ${fileName} for e2e tests`)
execSync(`cp ${path.join(desktop, 'dist', fileName)} ${path.join(e2e, 'Quiet', fileName)}`)
execSync(`echo "FILE_NAME=${fileName}" > ${path.join(e2e, '.env')}`)
execFileSync('cp', [path.join(desktop, 'dist', fileName), path.join(e2e, 'Quiet', fileName)])

fs.writeFileSync(path.join(e2e, '.env'), `FILE_NAME=${fileName}`)

0 comments on commit 5f80ac1

Please sign in to comment.