Socket
Socket
Sign inDemoInstall

electron-prebuilt

Package Overview
Dependencies
Maintainers
3
Versions
125
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

electron-prebuilt - npm Package Compare versions

Comparing version 0.25.1 to 0.25.2-1

cli.js

35

install.js

@@ -5,9 +5,11 @@ #!/usr/bin/env node

var path = require('path')
var pathExists = require('path-exists')
var mkdir = require('mkdirp')
var nugget = require('nugget')
var extract = require('extract-zip')
var fs = require('fs')
var getHomePath = require('home-path')()
var platform = os.platform()
var arch = os.arch()
var version = '0.25.1'
var version = '0.25.2'
var filename = 'electron-v' + version + '-' + platform + '-' + arch + '.zip'

@@ -26,23 +28,22 @@ var url = 'https://github.com/atom/electron/releases/download/v' + version + '/electron-v' + version + '-' + platform + '-' + arch + '.zip'

var shebang = {
darwin: '#!/bin/bash\n',
linux: '#!/bin/bash\n',
win32: ''
}
var cache = path.join(getHomePath, './.electron')
var argv = {
darwin: '"$@"',
linux: '"$@"',
win32: '%*' // does this work with " " in the args?
if (!paths[platform]) throw new Error('Unknown platform: ' + platform)
// use cache if possible
if (pathExists.sync(path.join(cache, filename))) {
extractFile()
} else {
mkdir(cache, function(err) {
if (err) return onerror(err)
nugget(url, {target: filename, dir: cache, resume: true, verbose: true}, extractFile)
})
}
if (!paths[platform]) throw new Error('Unknown platform: ' + platform)
nugget(url, {target: filename, dir: __dirname, resume: true, verbose: true}, function (err) {
function extractFile (err) {
if (err) return onerror(err)
fs.writeFileSync(path.join(__dirname, 'path.txt'), paths[platform])
fs.writeFileSync(path.join(__dirname, 'run.bat'), shebang[platform] + '"' + paths[platform] + '" ' + argv[platform])
extract(path.join(__dirname, filename), {dir: path.join(__dirname, 'dist')}, function (err) {
extract(path.join(cache, filename), {dir: path.join(__dirname, 'dist')}, function (err) {
if (err) return onerror(err)
})
})
}
{
"name": "electron-prebuilt",
"version": "0.25.1",
"version": "0.25.2-1",
"description": "Install electron (formerly called atom-shell) prebuilts using npm",

@@ -11,6 +11,7 @@ "repository": {

"install": "node install.js",
"test": "tape test/*.js"
"test": "tape test/*.js",
"cache-clean": "rimraf ~/.electron"
},
"bin": {
"electron": "run.bat"
"electron": "cli.js"
},

@@ -20,5 +21,9 @@ "main": "index.js",

"extract-zip": "^1.0.3",
"nugget": "^1.2.0"
"home-path": "^0.1.1",
"mkdirp": "^0.5.0",
"nugget": "^1.2.0",
"path-exists": "^1.0.0"
},
"devDependencies": {
"rimraf": "^2.3.3",
"tape": "^3.0.1"

@@ -25,0 +30,0 @@ },

var tape = require('tape')
var electron = require('../')
var fs = require('fs')
var path = require('path');
var pathExists = require('path-exists')
var getHomePath = require('home-path')()
tape('has binary', function(t) {
t.ok(fs.existsSync(electron), 'electron was downloaded')
tape('has local binary', function(t) {
t.ok(pathExists.sync(electron), 'electron was downloaded')
t.end()
})
})
tape('has cache folder', function(t) {
t.ok(pathExists.sync(path.join(getHomePath, './.electron')), 'cache exists')
t.end()
})

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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