nw 0.88.0-2 → 0.88.0-3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/package.json +1 -1
- package/src/util.js +13 -4
package/README.md
CHANGED
|
@@ -90,14 +90,14 @@ Executing `npm start` runs the NW.js app. Omitting the file path makes NW.js che
|
|
|
90
90
|
|
|
91
91
|
``` js
|
|
92
92
|
import { findpath } from 'nw';
|
|
93
|
-
|
|
93
|
+
let path = await findpath();
|
|
94
94
|
```
|
|
95
95
|
|
|
96
96
|
## Find the path to the chromedriver binary
|
|
97
97
|
|
|
98
98
|
``` js
|
|
99
99
|
import { findpath } from 'nw';
|
|
100
|
-
|
|
100
|
+
let path = await findpath('chromedriver', { flavor: 'sdk' });
|
|
101
101
|
```
|
|
102
102
|
|
|
103
103
|
## Download specific versions independant of installer version
|
package/package.json
CHANGED
package/src/util.js
CHANGED
|
@@ -43,21 +43,28 @@ const EXE_NAME = {
|
|
|
43
43
|
|
|
44
44
|
/**
|
|
45
45
|
* Get the platform dependant path of the NW.js or ChromeDriver binary.
|
|
46
|
-
*
|
|
47
|
-
* @param {'nwjs' | 'chromedriver'}
|
|
46
|
+
*
|
|
47
|
+
* @param {'nwjs' | 'chromedriver' | 'all'} Path to NW.js or Chromedriver executable.
|
|
48
48
|
* @return {Promise<string>}
|
|
49
49
|
*/
|
|
50
50
|
async function findpath(executable = 'nwjs', options = {}) {
|
|
51
51
|
options = await parse(options);
|
|
52
52
|
const nwDir = path.resolve(__dirname, '..', `nwjs${options.flavor === "sdk" ? "-sdk" : ""}-v${options.version}-${options.platform}-${options.arch}`);
|
|
53
|
-
|
|
53
|
+
|
|
54
54
|
/**
|
|
55
55
|
* File path to executable.
|
|
56
|
-
*
|
|
56
|
+
*
|
|
57
57
|
* @type {string}
|
|
58
58
|
*/
|
|
59
59
|
let binPath = '';
|
|
60
60
|
|
|
61
|
+
/**
|
|
62
|
+
* Get the platform dependant path of the NW.js directory containing everything.
|
|
63
|
+
*/
|
|
64
|
+
function findDir() {
|
|
65
|
+
binPath = nwDir;
|
|
66
|
+
}
|
|
67
|
+
|
|
61
68
|
/**
|
|
62
69
|
* Get the platform dependant path of the NW.js binary.
|
|
63
70
|
*/
|
|
@@ -76,6 +83,8 @@ async function findpath(executable = 'nwjs', options = {}) {
|
|
|
76
83
|
findNwjs();
|
|
77
84
|
} else if (executable === 'chromedriver') {
|
|
78
85
|
findChromeDriver();
|
|
86
|
+
} else if (executable === 'all') {
|
|
87
|
+
findDir();
|
|
79
88
|
} else {
|
|
80
89
|
console.error(`[ ERROR ] Expected nwjs or chromedriver, got ${executable}.`);
|
|
81
90
|
}
|