Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove tempfile dependency #146

Merged
merged 2 commits into from
Jul 14, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 9 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,25 +18,24 @@
},
"homepage": "https://github.com/electron-userland/electron-osx-sign",
"dependencies": {
"bluebird": "^3.4.7",
"bluebird": "^3.5.0",
"compare-version": "^0.1.2",
"debug": "^2.6.1",
"debug": "^2.6.8",
"isbinaryfile": "^3.0.2",
"minimist": "^1.2.0",
"plist": "^2.0.1",
"tempfile": "^1.1.1"
"plist": "^2.1.0"
},
"devDependencies": {
"electron-download": "^4.0.0",
"eslint": "^3.16.1",
"electron-download": "^4.1.0",
"eslint": "^4.2.0",
"eslint-config-eslint": "^4.0.0",
"extract-zip": "^1.6.0",
"extract-zip": "^1.6.5",
"mkdirp": "^0.5.1",
"rimraf": "^2.6.1",
"run-series": "^1.1.4",
"run-waterfall": "^1.1.3",
"standard": "^8.6.0",
"tape": "^4.6.3"
"standard": "^10.0.2",
"tape": "^4.7.0"
},
"scripts": {
"code-standard": "standard",
Expand All @@ -49,6 +48,6 @@
]
},
"engines": {
"node": ">=0.4.0"
"node": ">=4.0.0"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

electron-builder/electron-download requires in any case node 4.

}
}
6 changes: 4 additions & 2 deletions util-entitlements.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,16 @@
const path = require('path')

const plist = require('plist')
const tempfile = require('tempfile')
const os = require('os')

const util = require('./util')
const debuglog = util.debuglog
const getAppContentsPath = util.getAppContentsPath
const readFileAsync = util.readFileAsync
const writeFileAsync = util.writeFileAsync

let tmpFileCounter = 0

/**
* This function returns a promise completing the entitlements automation: The process includes checking in `Info.plist` for `ElectronTeamID` or setting parsed value from identity, and checking in entitlements file for `com.apple.security.application-groups` or inserting new into array. A temporary entitlements file may be created to replace the input for any changes introduced.
* @function
Expand Down Expand Up @@ -88,7 +90,7 @@ module.exports.preAutoEntitlements = function (opts) {
debuglog('`com.apple.security.application-groups` found in entitlements file: ' + appIdentifier)
}
// Create temporary entitlements file
var entitlementsPath = tempfile('.plist')
const entitlementsPath = path.join(os.tmpdir(), `tmp-entitlements-${process.pid.toString(16)}-${(tmpFileCounter++).toString(16)}.plist`)
opts.entitlements = entitlementsPath
return writeFileAsync(entitlementsPath, plist.build(entitlements), 'utf8')
.then(function () {
Expand Down