Merge pull request #14 from vector-im/dbkr/debcontrol

Use a custom control file for the Debian package
This commit is contained in:
David Baker
2019-12-13 17:16:43 +00:00
committed by GitHub
4 changed files with 31 additions and 1 deletions

View File

@@ -18,6 +18,9 @@ async function main() {
}
const ver = asar.extractFile('webapp.asar', 'version').toString().trim();
// set version in package.json: electron-builder will use this to populate
// all the various version fields
await new Promise((resolve, reject) => {
child_process.execFile('yarn', [
'version',
@@ -33,6 +36,15 @@ async function main() {
}
});
});
// Also create a debian package control file with the version.
// We use a custom control file so we need to do this ourselves
const outFile = await fs.open('pkg/control', 'w');
const template = await fs.readFile('pkg/control.template');
await outFile.write(template);
await outFile.write('Version: ' + ver + "\n");
await outFile.close();
console.log("Version set to " + ver);
}