Socket
Socket
Sign inDemoInstall

electron-installer-common

Package Overview
Dependencies
Maintainers
5
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

electron-installer-common - npm Package Compare versions

Comparing version 0.4.1 to 0.4.2

.eslintignore

10

NEWS.md

@@ -5,4 +5,12 @@ # `electron-installer-common` - Changes by Version

[Unreleased]: https://github.com/electron-userland/electron-installer-common/compare/v0.4.1...master
[Unreleased]: https://github.com/electron-userland/electron-installer-common/compare/v0.4.2...master
## [0.4.2] - 2019-01-03
[0.4.2]: https://github.com/electron-userland/electron-installer-common/compare/v0.4.1...v0.4.2
### Added
* Re-export public functions not already in `src/index.js` (#7)
## [0.4.1] - 2019-01-02

@@ -9,0 +17,0 @@

2

package.json
{
"name": "electron-installer-common",
"version": "0.4.1",
"version": "0.4.2",
"description": "Common functionality for creating distributable Electron apps",

@@ -5,0 +5,0 @@ "author": "Mark Lee",

'use strict'
const _ = require('lodash')
const asar = require('asar')
const dependencies = require('./dependencies')
const error = require('./error')
const fs = require('fs-extra')

@@ -9,2 +10,5 @@ const getHomePage = require('./gethomepage')

const path = require('path')
const readElectronVersion = require('./readelectronversion')
const readMetadata = require('./readmetadata')
const replaceScopeName = require('./replacescopename')
const spawn = require('./spawn')

@@ -23,6 +27,2 @@ const tmp = require('tmp-promise')

function errorMessage (message, err) {
return `Error ${message}: ${err.message || err}`
}
/**

@@ -41,3 +41,3 @@ * Create hicolor icon for the package.

.then(() => fs.chmod(iconFile, '0644'))
.catch(wrapError('creating hicolor icon file'))
.catch(error.wrapError('creating hicolor icon file'))
}))

@@ -55,6 +55,6 @@ }

return fs.ensureDir(path.dirname(iconFile), '0755')
.catch(wrapError('creating icon path'))
.catch(error.wrapError('creating icon path'))
.then(() => fs.copy(options.icon, iconFile))
.then(() => fs.chmod(iconFile, '0644'))
.catch(wrapError('creating icon file'))
.catch(error.wrapError('creating icon file'))
}

@@ -80,9 +80,2 @@

function wrapError (message) {
return err => {
/* istanbul ignore next */
throw new Error(errorMessage(message, err))
}
}
module.exports = {

@@ -98,3 +91,3 @@ /**

.then(() => fs.copy(options.src, applicationDir, { filter: ignoreFunc }))
.catch(wrapError('copying application directory'))
.catch(error.wrapError('copying application directory'))
},

@@ -119,3 +112,3 @@ /**

}).then(() => fs.symlink(binSrc, binDest, 'file'))
.catch(wrapError('creating binary symlink'))
.catch(error.wrapError('creating binary symlink'))
},

@@ -127,3 +120,3 @@ createContents: function createContents (options, dir, functions) {

.then(() => dir)
.catch(wrapError('creating contents of package'))
.catch(error.wrapError('creating contents of package'))
},

@@ -141,3 +134,3 @@ /**

.then(() => fs.chmod(copyrightFile, '0644'))
.catch(wrapError('creating copyright file'))
.catch(error.wrapError('creating copyright file'))
},

@@ -155,7 +148,7 @@ /**

return fs.ensureDir(path.dirname(desktopDest), '0755')
.catch(wrapError('creating desktop path'))
.catch(error.wrapError('creating desktop path'))
.then(() => generateTemplate(options, desktopSrc))
.then(data => fs.outputFile(desktopDest, data))
.then(() => fs.chmod(desktopDest, '0644'))
.catch(wrapError('creating desktop file'))
.catch(error.wrapError('creating desktop file'))
},

@@ -169,7 +162,7 @@ /**

return tmp.dir({ prefix: 'electron-', unsafeCleanup: true })
.catch(wrapError('creating temporary directory'))
.catch(error.wrapError('creating temporary directory'))
.then(dir => {
const tempDir = path.join(dir.path, `${options.name}_${options.version}_${options.arch}`)
return fs.ensureDir(tempDir, '0755')
}).catch(wrapError('changing permissions on temporary directory'))
}).catch(error.wrapError('changing permissions on temporary directory'))
},

@@ -187,3 +180,3 @@

},
errorMessage: errorMessage,
errorMessage: error.errorMessage,
generateTemplate: generateTemplate,

@@ -210,2 +203,8 @@ getDefaultsFromPackageJSON: function getDefaultsFromPackageJSON (pkg) {

},
getDepends: dependencies.getDepends,
getGConfDepends: dependencies.getGConfDepends,
getGTKDepends: dependencies.getGTKDepends,
getTrashDepends: dependencies.getTrashDepends,
getUUIDDepends: dependencies.getUUIDDepends,
mergeUserSpecified: dependencies.mergeUserSpecified,
/**

@@ -223,25 +222,9 @@ * Move the package to the specified destination.

return fs.move(file, dest, { clobber: true })
}))).catch(wrapError('moving package files'))
}))).catch(error.wrapError('moving package files'))
},
/**
* Read `package.json` either from `resources/app.asar` (if the app is packaged)
* or from `resources/app/package.json` (if it is not).
*/
readMeta: function readMeta (options) {
const appAsarPath = path.join(options.src, 'resources/app.asar')
const appPackageJSONPath = path.join(options.src, 'resources/app/package.json')
return fs.pathExists(appAsarPath)
.then(asarExists => {
if (asarExists) {
options.logger(`Reading package metadata from ${appAsarPath}`)
return JSON.parse(asar.extractFile(appAsarPath, 'package.json'))
} else {
options.logger(`Reading package metadata from ${appPackageJSONPath}`)
return fs.readJson(appPackageJSONPath)
}
}).catch(wrapError('reading package metadata'))
},
readElectronVersion: readElectronVersion,
readMeta: readMetadata,
replaceScopeName: replaceScopeName,
spawn: spawn,
wrapError: wrapError
wrapError: error.wrapError
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc