Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

openfin-cli

Package Overview
Dependencies
Maintainers
11
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

openfin-cli - npm Package Compare versions

Comparing version 1.1.6 to 2.0.2

75

index.js
'use strict';
var configBuilder = require('openfin-config-builder'),
openfinLauncher = require('openfin-launcher'),
{ connect } = require('hadouken-js-adapter'),
path = require('path'),

@@ -28,10 +28,4 @@ fs = require('fs'),

try {
writeToConfig(name, parsedUrl, config, devtools_port, runtime_version, function(configObj) {
if (launch) {
launchOpenfin(config);
}
if (configObj) {
fetchInstaller(flags, configObj);
}
writeToConfig(name, parsedUrl, config, devtools_port, runtime_version, function (configObj) {
if (launch) launchOpenfin(config);
});

@@ -43,37 +37,2 @@ } catch (err) {

function fetchInstaller(flags, configObj) {
var hyperlink = flags.h || flags.hyperlink,
destination = flags.d || flags.destination,
appName = configObj.startup_app ? configObj.startup_app.name : null,
name = flags.n || flags.name || appName || 'openfin',
openfinInstaller = require('openfin-installer')(configObj),
fetchOptions = {
noExt: flags.noExt || null,
rvmConfig: flags.rvmConfig || null,
supportEmail: flags.supportEmail || null,
dnl: flags.dnl || null,
destination: flags.d || flags.destination,
config: flags.c || null,
name: name
};
if (destination) {
openfinInstaller
.fetchInstaller(fetchOptions)
.then(function() {
console.log('Installer zip written to', destination);
},
function(reason) {
console.log(reason);
});
}
if (hyperlink) {
console.log('\n', openfinInstaller.generateInstallUrl(encodeURIComponent(name), fetchOptions.config,
fetchOptions.noExt, fetchOptions.rvmConfig, fetchOptions.supportEmail, fetchOptions.dnl), '\n');
}
}
function isURL(str) {

@@ -99,8 +58,14 @@ return (typeof str === 'string') && str.lastIndexOf('http') >= 0;

//will launch download the rvm and launch openfin
function launchOpenfin(config) {
openfinLauncher.launchOpenFin({
configPath: isURL(config) ? config : path.resolve(config)
}).fail(function(err) {
onError('launch failed', err);
});
async function launchOpenfin(config) {
try {
const manifestUrl = isURL(config) ? config : path.resolve(config);
const fin = await connect({
uuid: 'openfin-cli-server-connection',
manifestUrl,
nonPersistent: true
});
fin.once('disconnected', process.exit);
} catch (err) {
console.error(err);
}
}

@@ -111,3 +76,3 @@

if (isURL(config)) {
request(config, function(err, response, body) {
request(config, function (err, response, body) {
if (!err && response.statusCode === 200) {

@@ -126,3 +91,3 @@ callback(JSON.parse(body));

fs.exists(config, function(exists) {
fs.exists(config, function (exists) {
if (exists) {

@@ -154,3 +119,3 @@ configAction = configBuilder.update;

shortcut: shortcut
}
};

@@ -166,5 +131,5 @@ if (devtools_port) {

//create or update the config
configAction(appConfigObj, config).fail(function(err) {
configAction(appConfigObj, config).fail(function (err) {
console.log(err);
}).done(function(configObj) {
}).done(function (configObj) {
console.log(actionMessage, path.resolve(config));

@@ -171,0 +136,0 @@ callback(configObj);

{
"name": "openfin-cli",
"version": "1.1.6",
"version": "2.0.2",
"description": "OpenFin Runtime cli tool",

@@ -25,6 +25,6 @@ "homepage": "http://www.openfin.co",

"dependencies": {
"hadouken-js-adapter": "^0.36.1-alpha.1",
"meow": "^5.0.0",
"openfin-config-builder": "latest",
"openfin-installer": "latest",
"openfin-launcher": "latest",
"request": "^2.87.0"

@@ -31,0 +31,0 @@ },

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