openfin-cli
Advanced tools
Comparing version 1.1.5 to 1.1.6
11
cli.js
@@ -6,2 +6,10 @@ #!/usr/bin/env node | ||
openfinCli = require('./'); | ||
const options = { | ||
flags: { | ||
name: { alias: 'n', type: 'string' }, | ||
url: { alias: 'u', type: 'string' }, | ||
config: { alias: 'c', type: 'string' }, | ||
launch: { alias: 'l', type: 'boolean' } | ||
} | ||
}; | ||
@@ -16,2 +24,4 @@ var cli = meow({ | ||
'-l --launch launch this configuration', | ||
'-p --devtools-port devtools port number', | ||
'-v --runtime-version runtime version', | ||
@@ -22,3 +32,2 @@ '-i --installer a url to an OpenFin config file ', | ||
'--file-name <application name to be used in the config>', | ||
@@ -25,0 +34,0 @@ '--no-ext <If set “true”, the file is extention-less>', |
29
index.js
@@ -18,2 +18,4 @@ 'use strict'; | ||
launch = flags.l || flags.launch, | ||
devtools_port = flags.p || flags.devtoolsPort, | ||
runtime_version = flags.v || flags.runtimeVersion, | ||
parsedUrl = url ? parseURLOrFile(url) : url; | ||
@@ -27,3 +29,3 @@ | ||
try { | ||
writeToConfig(name, parsedUrl, config, function(configObj) { | ||
writeToConfig(name, parsedUrl, config, devtools_port, runtime_version, function(configObj) { | ||
if (launch) { | ||
@@ -84,3 +86,3 @@ launchOpenfin(config); | ||
for (var key in flags) { | ||
if (flags.hasOwnProperty(key)) { | ||
if (flags.hasOwnProperty(key) && flags[key] !== false) { | ||
return false; | ||
@@ -107,3 +109,3 @@ } | ||
//write the specified config to disk. | ||
function writeToConfig(name, url, config, callback) { | ||
function writeToConfig(name, url, config, devtools_port, runtime_version, callback) { | ||
if (isURL(config)) { | ||
@@ -120,2 +122,3 @@ request(config, function(err, response, body) { | ||
startup_app = {}, | ||
runtime = {}, | ||
configAction, | ||
@@ -142,9 +145,23 @@ actionMessage; | ||
} | ||
if (runtime_version) { | ||
runtime.version = runtime_version; | ||
} | ||
} | ||
//create or update the config | ||
configAction({ | ||
var appConfigObj = { | ||
startup_app: url ? startup_app : null, | ||
shortcut: shortcut | ||
}, config).fail(function(err) { | ||
} | ||
if (devtools_port) { | ||
appConfigObj.devtools_port = devtools_port; | ||
} | ||
if (runtime_version) { | ||
appConfigObj.runtime = runtime; | ||
} | ||
//create or update the config | ||
configAction(appConfigObj, config).fail(function(err) { | ||
console.log(err); | ||
@@ -151,0 +168,0 @@ }).done(function(configObj) { |
{ | ||
"name": "openfin-cli", | ||
"version": "1.1.5", | ||
"version": "1.1.6", | ||
"description": "OpenFin Runtime cli tool", | ||
@@ -11,2 +11,5 @@ "homepage": "http://www.openfin.co", | ||
}, | ||
"engines": { | ||
"node": ">=6" | ||
}, | ||
"repository": "openfin/openfin-cli", | ||
@@ -23,20 +26,22 @@ "license": "MIT", | ||
"dependencies": { | ||
"meow": "^2.0.0", | ||
"meow": "^5.0.0", | ||
"openfin-config-builder": "latest", | ||
"openfin-installer": "latest", | ||
"openfin-launcher": "latest", | ||
"request": "^2.53.0" | ||
"request": "^2.87.0" | ||
}, | ||
"devDependencies": { | ||
"grunt-cli": "^0.1.13", | ||
"grunt-contrib-jshint": "^0.10.0", | ||
"grunt-contrib-nodeunit": "^0.4.1", | ||
"grunt-contrib-watch": "^0.6.1", | ||
"load-grunt-tasks": "^1.0.0", | ||
"time-grunt": "^1.0.0", | ||
"grunt-mocha-cli": "^1.11.0", | ||
"grunt": "^1.0.3", | ||
"grunt-cli": "^1.2.0", | ||
"grunt-contrib-jshint": "^1.1.0", | ||
"grunt-contrib-nodeunit": "^2.0.0", | ||
"grunt-contrib-watch": "^1.1.0", | ||
"grunt-jsbeautifier": "^0.2.7", | ||
"grunt-mocha-cli": "^4.0.0", | ||
"jshint-stylish": "^1.0.0", | ||
"grunt-jsbeautifier": "^0.2.7" | ||
"load-grunt-tasks": "^4.0.0", | ||
"time-grunt": "^1.0.0" | ||
}, | ||
"scripts": { | ||
"start": "node cli", | ||
"test": "grunt mochacli" | ||
@@ -43,0 +48,0 @@ }, |
@@ -24,5 +24,5 @@ # OpenFin Runtime cli tool | ||
##Examples | ||
## Examples | ||
####Launching OpenFin Demos | ||
#### Launching OpenFin Demos | ||
``` | ||
@@ -33,3 +33,3 @@ $ openfin --launch --config http://cdn.openfin.co/demos/hyperblotter/app.json | ||
####Launching an application | ||
#### Launching an application | ||
@@ -45,3 +45,3 @@ ```sh | ||
####Creating a config file | ||
#### Creating a config file | ||
@@ -57,3 +57,3 @@ ```sh | ||
####Launching a given config file | ||
#### Launching a given config file | ||
@@ -71,23 +71,23 @@ ```sh | ||
####Generate installer URL | ||
#### Generate installer URL | ||
Will print a url to the console with the name proivided via the `-n` flag and the hosted confg | ||
file url provided via the `-c` flag | ||
````sh | ||
```sh | ||
$ openfin -n OpenFinPOC -c http://goo.gl/w2747v -h | ||
```` | ||
``` | ||
####Download an installer zip locally | ||
#### Download an installer zip locally | ||
Use the `-d` or `--destination` flag to specify the directory of the download. To download to the current directory use `-d .` or `--destination .` | ||
````sh | ||
```sh | ||
$ openfin --destination my-dist-directory --installer http://goo.gl/w2747v | ||
```` | ||
``` | ||
Shorthand | ||
````sh | ||
```sh | ||
$ openfin -d my-dist-directory -i http://goo.gl/w2747v | ||
```` | ||
``` | ||
####Installer config options | ||
```` | ||
#### Installer config options | ||
``` | ||
--no-ext If set “true”, the file is extention-less' | ||
@@ -98,3 +98,3 @@ --rvm-config URL that points to the RVM config. Must be a full URL.' | ||
```` | ||
``` | ||
## License | ||
@@ -104,3 +104,5 @@ | ||
By downloading OpenFin, you agree to the terms of our [Developer License](https://openfin.co/developer-agreement/) | ||
[npm-url]: https://npmjs.org/package/openfin-cli | ||
@@ -107,0 +109,0 @@ [npm-image]: https://badge.fury.io/js/openfin-cli.svg |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
22161
194
107
10
1
+ Addedarray-find-index@1.0.2(transitive)
+ Addedarrify@1.0.1(transitive)
+ Addedcamelcase@4.1.0(transitive)
+ Addedcamelcase-keys@4.2.0(transitive)
+ Addedcurrently-unhandled@0.4.1(transitive)
+ Addeddecamelize@1.2.0(transitive)
+ Addeddecamelize-keys@1.1.1(transitive)
+ Addederror-ex@1.3.2(transitive)
+ Addedfind-up@2.1.0(transitive)
+ Addedfunction-bind@1.1.2(transitive)
+ Addedgraceful-fs@4.2.11(transitive)
+ Addedhasown@2.0.2(transitive)
+ Addedhosted-git-info@2.8.9(transitive)
+ Addedindent-string@3.2.0(transitive)
+ Addedis-arrayish@0.2.1(transitive)
+ Addedis-core-module@2.15.1(transitive)
+ Addedis-plain-obj@1.1.0(transitive)
+ Addedjson-parse-better-errors@1.0.2(transitive)
+ Addedload-json-file@4.0.0(transitive)
+ Addedlocate-path@2.0.0(transitive)
+ Addedloud-rejection@1.6.0(transitive)
+ Addedmap-obj@2.0.0(transitive)
+ Addedmeow@5.0.0(transitive)
+ Addedminimist-options@3.0.2(transitive)
+ Addednormalize-package-data@2.5.0(transitive)
+ Addedp-limit@1.3.0(transitive)
+ Addedp-locate@2.0.0(transitive)
+ Addedp-try@1.0.0(transitive)
+ Addedparse-json@4.0.0(transitive)
+ Addedpath-exists@3.0.0(transitive)
+ Addedpath-parse@1.0.7(transitive)
+ Addedpath-type@3.0.0(transitive)
+ Addedpify@3.0.0(transitive)
+ Addedquick-lru@1.1.0(transitive)
+ Addedread-pkg@3.0.0(transitive)
+ Addedread-pkg-up@3.0.0(transitive)
+ Addedredent@2.0.0(transitive)
+ Addedresolve@1.22.8(transitive)
+ Addedsemver@5.7.2(transitive)
+ Addedsignal-exit@3.0.7(transitive)
+ Addedspdx-correct@3.2.0(transitive)
+ Addedspdx-exceptions@2.5.0(transitive)
+ Addedspdx-expression-parse@3.0.1(transitive)
+ Addedspdx-license-ids@3.0.20(transitive)
+ Addedstrip-bom@3.0.0(transitive)
+ Addedstrip-indent@2.0.0(transitive)
+ Addedsupports-preserve-symlinks-flag@1.0.0(transitive)
+ Addedtrim-newlines@2.0.0(transitive)
+ Addedvalidate-npm-package-license@3.0.4(transitive)
+ Addedyargs-parser@10.1.0(transitive)
Updatedmeow@^5.0.0
Updatedrequest@^2.87.0