Skip to content

Commit

Permalink
Make code more readable
Browse files Browse the repository at this point in the history
  • Loading branch information
fcastilloec committed May 31, 2019
1 parent 251fa49 commit f38603d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
5 changes: 4 additions & 1 deletion src/installer.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,10 @@ class SquirrelInstaller extends common.ElectronInstaller {
const packagePattern = path.join(this.stagingDir, 'nuget', '*.nupkg')
this.options.logger(`Finding package with pattern ${packagePattern}`)

return common.wrapError('finding package with pattern', async () => (await glob(packagePattern))[0])
return common.wrapError('finding package with pattern', async () => {
const files = await glob(packagePattern)
return files[0]
})
}

/**
Expand Down
9 changes: 2 additions & 7 deletions test/helpers/describe_cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const chai = require('chai')
const fs = require('fs-extra')
const { spawn } = require('electron-installer-common')
const tmp = require('tmp-promise')
const { access, testAccess, accessAll } = require('./access_helper')
const { access, accessAll } = require('./access_helper')

function printLogs (logs) {
if (process.env.DEBUG === 'electron-installer-windows') {
Expand Down Expand Up @@ -49,12 +49,7 @@ module.exports = function (desc, asar, options) {

if (options.remoteReleases && asar) {
it('does not generate a delta `.nupkg` package', async () => {
try {
await testAccess(`${options.dest}/${appName}-0.0.1-delta.nupkg'`)
throw new Error('delta `.nupkg` was created')
} catch (error) {
chai.expect(error.message).to.have.string('no such file or directory')
}
return chai.expect(await fs.pathExists(`${options.dest}/${appName}-0.0.1-delta.nupkg'`)).to.be.false
})
}

Expand Down

0 comments on commit f38603d

Please sign in to comment.