openfin-cli
Advanced tools
Comparing version 3.0.1 to 3.0.2-beta.1
@@ -14,3 +14,4 @@ #!/usr/bin/env node | ||
runtime: { alias: 'r', type: 'string' }, | ||
platform: { alias: 't', type: 'boolean' } | ||
platform: { alias: 't', type: 'boolean' }, | ||
save: { alias: 's', type: 'string' } | ||
} | ||
@@ -23,3 +24,3 @@ }; | ||
'Options:', | ||
'-c --config <config file>', | ||
'-c --config <path to config file>', | ||
'-u --url <application url>', | ||
@@ -29,2 +30,3 @@ '-l --launch launch this configuration', | ||
'-r --runtime-version runtime version', | ||
'-s --save the manifest to the current directory <manifest name>', | ||
'--version current version of the tool', | ||
@@ -31,0 +33,0 @@ 'Example', |
17
index.js
@@ -17,2 +17,3 @@ 'use strict'; | ||
const isPlatform = flags.t || flags.platform; | ||
const manifestName = flags.s || flags.save | ||
let manifestUrl = flags.c || flags.config || null; | ||
@@ -30,3 +31,3 @@ let buildConfig; | ||
buildConfig = true; | ||
const manifestInfo = await writeManifest(url, devtoolsPort, runtime, isPlatform); | ||
const manifestInfo = await writeManifest(url, devtoolsPort, runtime, isPlatform, manifestName); | ||
manifestUrl = manifestInfo.filepath; | ||
@@ -85,3 +86,3 @@ configObj = manifestInfo.manifest; | ||
function writeManifest(url, devtoolsPort, runtime, isPlatform) { | ||
function writeManifest(url, devtoolsPort, runtime, isPlatform, manifestName) { | ||
return new Promise((resolve, reject) => { | ||
@@ -159,9 +160,11 @@ const uuid = `app-${getUuid()}`; | ||
const manifestJson = JSON.stringify(manifest, null, 4); | ||
let filepath; | ||
if (manifestName) { | ||
filepath = path.join(process.cwd(), manifestName); | ||
} else { | ||
filepath = path.join(os.tmpdir(), `${uuid}.json`); | ||
} | ||
const manifestJson = JSON.stringify(manifest); | ||
const filepath = path.join(os.tmpdir(), `${uuid}.json`); | ||
fs.writeFile(filepath, manifestJson, (error) => { | ||
@@ -168,0 +171,0 @@ if (error) { |
{ | ||
"name": "openfin-cli", | ||
"version": "3.0.1", | ||
"version": "3.0.2-beta.1", | ||
"description": "OpenFin Runtime cli tool", | ||
@@ -5,0 +5,0 @@ "homepage": "http://www.openfin.co", |
@@ -42,2 +42,15 @@ # OpenFin Runtime cli tool | ||
``` | ||
#### Launch application and save manifest to the working directory | ||
```sh | ||
$ openfin --launch --url http://www.openfin.co --save myconfig.json | ||
``` | ||
Shorthand | ||
```sh | ||
$ openfin -l -u http://www.openfin.co -s myconfig.json | ||
``` | ||
#### Launching a given config file | ||
@@ -58,3 +71,3 @@ | ||
``` | ||
$ openfin -launch -platform -url https://openfin.co,http://cdn.openfin.co/demos/hyperblotter/index.html,https://google.com | ||
$ openfin --launch --platform --url https://openfin.co,http://cdn.openfin.co/demos/hyperblotter/index.html,https://google.com | ||
``` | ||
@@ -61,0 +74,0 @@ |
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
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
23713
256
91
1