Skip to content

Commit

Permalink
fix: add revision, when present, to output filename (#199)
Browse files Browse the repository at this point in the history
  • Loading branch information
fcastilloec authored and malept committed Jun 6, 2019
1 parent 55afbae commit 6edca5d
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 15 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -273,9 +273,9 @@ Version number of the package, used in the [`Version` field of the `control` spe

#### options.revision
Type: `String`
Default: `package.revision || "1"`
Default: `undefined`

Revision number of the package, used in the [`Version` field of the `control` specification](https://www.debian.org/doc/debian-policy/#version).
Revision number of the package, used in the [`Version` field of the `control` specification](https://www.debian.org/doc/debian-policy/#version) and, by default, the filename of the generated `.deb` file.

#### options.section
Type: `String`
Expand Down
2 changes: 1 addition & 1 deletion src/installer.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const spawn = require('./spawn')
const defaultLogger = debug('electron-installer-debian')

const defaultRename = (dest, src) => {
return path.join(dest, '<%= name %>_<%= version %>_<%= arch %>.deb')
return path.join(dest, '<%= name %>_<%= version %><% if (revision) { %>-<%= revision %><% } %>_<%= arch %>.deb')
}

/**
Expand Down
4 changes: 2 additions & 2 deletions test/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ describe('cli', function () {
describe('with an app with asar', test => {
const outputDir = tempOutputDir()

runCLI({ src: 'test/fixtures/app-with-asar/', dest: outputDir, arch: 'i386' })
runCLI({ src: 'test/fixtures/app-with-asar/', dest: outputDir, arch: 'i386', config: 'test/fixtures/config.json' })

it('generates a `.deb` package', () => access(path.join(outputDir, 'footest_0.0.1_i386.deb')))
it('generates a `.deb` package', () => access(path.join(outputDir, 'footest_0.0.1-2_i386.deb')))

cleanupOutputDir(outputDir)
})
Expand Down
11 changes: 1 addition & 10 deletions test/fixtures/config.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,3 @@
{
"productDescription": "Just a test.",
"section": "devel",
"priority": "optional",
"arch": "i386",
"depends" : ["libnss3", "libxtst6", "dbus", "dbus"],
"recommends" : ["pulseaudio | libasound2", "bzip2", "bzip2"],
"suggests" : ["lsb-release", "gvfs", "gvfs"],
"enhances" : ["libc6", "libc6"],
"preDepends" : ["footest", "footest"],
"categories": []
"revision": "2"
}

0 comments on commit 6edca5d

Please sign in to comment.