-
Notifications
You must be signed in to change notification settings - Fork 88
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: 'copy app image for e2e' script
- Loading branch information
Showing
1 changed file
with
6 additions
and
4 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
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}`) |