Skip to content
Permalink
Browse files

fix(maker-deb): return the correct outPath with a prerelease version (#…

…584)

* fix(maker-deb): return the correct outPath with a prerelease version

ISSUES CLOSED: #583

* chore(generic): upgrade node-abi to avoid warning
  • Loading branch information
malept authored and MarshallOfSound committed Oct 9, 2018
1 parent 82e8c85 commit a4fbc0a7cf48c6f80a84811812829a0956ef0132
Showing with 1,550 additions and 39 deletions.
  1. +1 −1 package.json
  2. +1 −1 packages/maker/deb/package.json
  3. +1 −1 packages/maker/deb/src/MakerDeb.ts
  4. +10 −0 packages/maker/deb/test/MakerDeb_spec.ts
  5. +1,537 −36 yarn.lock
@@ -152,7 +152,7 @@
"typescript": "^2.8.1"
},
"optionalDependencies": {
"electron-installer-debian": "^0.8.0",
"electron-installer-debian": "^1.0.0",
"electron-installer-dmg": "^2.0.0",
"electron-installer-flatpak": "^0.8.0",
"electron-installer-redhat": "^0.5.0",
@@ -25,6 +25,6 @@
"@electron-forge/shared-types": "6.0.0-beta.28"
},
"optionalDependencies": {
"electron-installer-debian": "^0.8.0"
"electron-installer-debian": "^1.0.0"
}
}
@@ -32,7 +32,7 @@ export default class MakerDeb extends MakerBase<MakerDebConfig> {

const arch = debianArch(targetArch);
const name = (this.config.options || {}).name || packageJSON.name;
const versionedName = `${name}_${packageJSON.version}_${arch}`;
const versionedName = `${name}_${installer.transformVersion(packageJSON.version)}_${arch}`;
const outPath = path.resolve(makeDir, `${versionedName}.deb`);

await this.ensureFile(outPath);
@@ -28,6 +28,7 @@ describe('MakerDeb', () => {
beforeEach(() => {
ensureFileStub = stub().returns(Promise.resolve());
eidStub = stub().resolves();
(eidStub as any).transformVersion = (version: string) => version;
config = {};

MakerDeb = proxyquire.noPreserveCache().noCallThru().load('../src/MakerDeb', {
@@ -77,6 +78,15 @@ describe('MakerDeb', () => {
});
});

if (process.platform === 'linux') {
it('should return the proper pre-release version in the outPath', async () => {
(eidStub as any).transformVersion = require('electron-installer-debian').transformVersion;
packageJSON.version = '1.2.3-beta.4';
const outPath = await (maker.make as any)({ dir, makeDir, appName, targetArch, packageJSON });
expect(outPath).to.match(/1\.2\.3~beta\.4/);
});
}

describe('debianArch', () => {
it('should convert ia32 to i386', () => {
expect(debianArch('ia32')).to.equal('i386');

0 comments on commit a4fbc0a

Please sign in to comment.
You can’t perform that action at this time.