nw-builder 3.6.0 → 3.7.2

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.
Files changed (86) hide show
  1. package/.editorconfig +17 -0
  2. package/.github/CHANGELOG.md +77 -35
  3. package/.github/CODE_OF_CONDUCT.md +55 -0
  4. package/.github/{ISSUE_REQUEST_TEMPLATE.md → ISSUE_TEMPLATE.md} +1 -0
  5. package/.github/workflows/cd.yml +3 -3
  6. package/.github/workflows/ci.yml +9 -5
  7. package/README.md +81 -23
  8. package/bin/nwbuild.cjs +102 -0
  9. package/dist/index.cjs +1 -0
  10. package/lib/Version.cjs +81 -0
  11. package/lib/downloader.cjs +177 -0
  12. package/lib/index.cjs +1078 -0
  13. package/lib/{platformOverrides.js → platformOverrides.cjs} +61 -36
  14. package/lib/utils.cjs +293 -0
  15. package/lib/versions.cjs +206 -0
  16. package/package.json +57 -29
  17. package/src/constants/Platform.js +16 -0
  18. package/src/constants/Platforms.js +143 -0
  19. package/src/constants/index.js +7 -0
  20. package/src/index.js +2 -0
  21. package/src/utilities/checkCache.js +30 -0
  22. package/src/utilities/detectCurrentPlatform.js +24 -0
  23. package/src/utilities/index.js +4 -0
  24. package/{example/icons → test/demo}/icon.icns +0 -0
  25. package/{example/icons → test/demo}/icon.ico +0 -0
  26. package/test/demo/index.cjs +14 -0
  27. package/test/demo/index.html +10 -0
  28. package/{example/nwapp → test/demo}/package.json +7 -6
  29. package/test/downloader.cjs +131 -0
  30. package/test/expected/README.md +1 -1
  31. package/test/expected/merged +1 -1
  32. package/test/expected/oneOveriddenRestNot/README.md +1 -1
  33. package/test/expected/oneOveriddenRestNot/osx32.json +7 -7
  34. package/test/expected/oneOveriddenRestNot/osx64.json +7 -7
  35. package/test/expected/osx-plist/README.md +1 -1
  36. package/test/expected/platformOverrides/README.md +1 -1
  37. package/test/expected/platformOverrides/linux32.json +12 -12
  38. package/test/expected/platformOverrides/linux64.json +8 -8
  39. package/test/expected/platformOverrides/osx32.json +10 -10
  40. package/test/expected/platformOverrides/osx64.json +10 -10
  41. package/test/expected/platformOverrides/win32.json +10 -10
  42. package/test/expected/platformOverrides/win64.json +10 -10
  43. package/test/fixtures/README.md +1 -1
  44. package/test/fixtures/invalid.json +1 -1
  45. package/test/fixtures/manifest/README.md +1 -1
  46. package/test/fixtures/manifest/versions.json +9 -3
  47. package/test/fixtures/nwapp/README.md +1 -1
  48. package/test/fixtures/nwapp/images/imagefile.img +1 -1
  49. package/test/fixtures/nwapp/index.html +5 -2
  50. package/test/fixtures/nwapp/javascript/bower_packages/simple/package.json +1 -1
  51. package/test/fixtures/nwapp/javascript/jsfile.js +1 -1
  52. package/test/fixtures/nwapp/package.json +1 -1
  53. package/test/fixtures/oneOveriddenRestNot/README.md +1 -1
  54. package/test/fixtures/oneOveriddenRestNot/package.json +13 -13
  55. package/test/fixtures/osx-plist/README.md +1 -1
  56. package/test/fixtures/platformOverrides/README.md +1 -1
  57. package/test/fixtures/platformOverrides/package.json +68 -48
  58. package/test/fixtures/testVersions.html +73 -16
  59. package/test/nwBuilder.cjs +339 -0
  60. package/test/unit/checkCache.test.js +19 -0
  61. package/test/unit/checkCacheDir/v0.64.1/linux64/nw1.app +0 -0
  62. package/test/unit/checkCacheDir/v0.64.1/linux64/nw2.app +0 -0
  63. package/test/unit/detectCurrentPlatform.test.js +58 -0
  64. package/test/utils.cjs +310 -0
  65. package/test/versions.cjs +485 -0
  66. package/bin/nwbuild +0 -98
  67. package/demo.js +0 -22
  68. package/example/icons/README.md +0 -7
  69. package/example/nwapp/Credits.html +0 -9
  70. package/example/nwapp/README.md +0 -7
  71. package/example/nwapp/images/README.md +0 -7
  72. package/example/nwapp/images/kitten.jpg +0 -0
  73. package/example/nwapp/index.html +0 -22
  74. package/example/package.json +0 -7
  75. package/index.js +0 -1
  76. package/lib/Version.js +0 -60
  77. package/lib/detectCurrentPlatform.js +0 -17
  78. package/lib/downloader.js +0 -192
  79. package/lib/index.js +0 -873
  80. package/lib/platforms.js +0 -76
  81. package/lib/utils.js +0 -249
  82. package/lib/versions.js +0 -198
  83. package/test/downloader.js +0 -87
  84. package/test/nwBuilder.js +0 -237
  85. package/test/utils.js +0 -232
  86. package/test/versions.js +0 -330
package/package.json CHANGED
@@ -1,60 +1,69 @@
1
1
  {
2
2
  "name": "nw-builder",
3
- "version": "3.6.0",
4
- "description": "Build NW.js applications for Mac, Windows and Linux.",
5
- "keywords": ["NW.js", "Desktop", "Application"],
6
- "author": "Steffen Müller",
3
+ "version": "3.7.2",
4
+ "description": "Build NW.js desktop applications for Mac, Windows and Linux.",
5
+ "keywords": [
6
+ "NW.js",
7
+ "Desktop",
8
+ "Application"
9
+ ],
10
+ "author": "Steffen Müller <steffen@mllrsohn.com>",
7
11
  "license": "MIT",
8
- "main": "index.js",
9
- "homepage": "https://github.com/nwjs-community/nw-builder",
12
+ "main": "lib/index.js",
13
+ "type": "module",
14
+ "homepage": "https://github.com/nwutils/nw-builder",
10
15
  "repository": {
11
16
  "type": "git",
12
- "url": "https://github.com/nwjs-community/nw-builder.git"
17
+ "url": "https://github.com/nwutils/nw-builder.git"
13
18
  },
14
19
  "scripts": {
15
- "format": "prettier --write ./lib",
16
- "lint": "eslint --ext .js ./lib",
17
- "test": "tape test/*.js",
18
- "demo": "node ./demo.js"
20
+ "format": "prettier --write ./bin ./lib ./src ./test",
21
+ "lint": "eslint ./bin/**.cjs ./lib/**.cjs ./src/**.js ./test/**.cjs ",
22
+ "test": "pnpm test:unit && tape './test/*.cjs'",
23
+ "test:unit": "node --experimental-vm-modules node_modules/jest/bin/jest.js",
24
+ "demo": "cd ./test/demo && pnpm start",
25
+ "build": "esbuild src/index.js --bundle --minify --platform=node --outfile=./dist/index.cjs"
19
26
  },
20
27
  "devDependencies": {
21
28
  "decompress-zip": "0.3.3",
22
29
  "eol": "0.9.1",
23
- "eslint": "8.15.0",
24
- "nock": "9.0.5",
30
+ "esbuild": "0.14.42",
31
+ "eslint": "8.16.0",
32
+ "eslint-plugin-jsdoc": "^39.3.2",
33
+ "jest": "28.1.0",
34
+ "jest-environment-jsdom": "28.1.0",
35
+ "jsdom": "19.0.0",
36
+ "nock": "13.2.4",
37
+ "pnpm": "7.1.7",
25
38
  "prettier": "2.6.2",
26
39
  "redtape": "1.0.0",
27
- "tap-spec": "4.1.1",
28
- "tape": "4.9.0"
40
+ "tape": "5.5.3"
29
41
  },
30
42
  "dependencies": {
31
- "archiver": "2.1.1",
32
- "boxen": "1.1.0",
33
- "chalk": "2.3.2",
43
+ "archiver": "5.3.1",
34
44
  "deprecate": "1.1.1",
35
- "extract-zip": "1.6.5",
45
+ "extract-zip": "2.0.1",
36
46
  "graceful-fs-extra": "2.0.0",
37
47
  "graceful-ncp": "3.0.0",
38
48
  "inherits": "2.0.4",
39
- "lazy-req": "2.0.0",
40
49
  "lodash": "4.17.21",
41
- "optimist": "0.6.1",
42
50
  "plist": "3.0.5",
43
51
  "progress": "2.0.3",
44
- "rcedit": "1.0.0",
52
+ "rcedit": "3.0.1",
45
53
  "recursive-readdir-sync": "1.0.6",
46
54
  "request": "2.88.2",
47
- "rimraf": "2.5.2",
48
- "semver": "5.5.0",
55
+ "rimraf": "3.0.2",
56
+ "semver": "7.3.7",
49
57
  "simple-glob": "0.2.0",
50
- "tar-fs": "1.16.2",
58
+ "tar-fs": "2.1.1",
51
59
  "temp": "github:adam-lynch/node-temp#remove_tmpdir_dep",
52
60
  "thenify": "3.3.1",
53
- "update-notifier": "2.4.0",
54
- "winresourcer": "0.9.0"
61
+ "update-notifier": "5.1.0",
62
+ "winresourcer": "0.9.0",
63
+ "yargs": "17.5.1"
55
64
  },
56
65
  "bin": {
57
- "nwbuild": "./bin/nwbuild"
66
+ "nwbuild": "./bin/nwbuild.cjs"
58
67
  },
59
68
  "prettier": {
60
69
  "printWidth": 80,
@@ -73,6 +82,25 @@
73
82
  "singleAttributePerLine": true
74
83
  },
75
84
  "eslintConfig": {
76
- "extends": "eslint:recommended"
85
+ "extends": "eslint:recommended",
86
+ "parserOptions": {
87
+ "ecmaVersion": 2021,
88
+ "sourceType": "module"
89
+ },
90
+ "env": {
91
+ "es6": true,
92
+ "node": true
93
+ },
94
+ "overrides": [
95
+ {
96
+ "files": "./src/**/*.js"
97
+ }
98
+ ],
99
+ "plugins": [
100
+ "jsdoc"
101
+ ]
102
+ },
103
+ "jest": {
104
+ "testEnvironment": "jsdom"
77
105
  }
78
106
  }
@@ -0,0 +1,16 @@
1
+ /**
2
+ * @readonly
3
+ * @enum {string}
4
+ */
5
+ const Platform = {
6
+ NIX_32: "linux32",
7
+ NIX_64: "linux64",
8
+ OSX_32: "osx32",
9
+ OSX_64: "osx64",
10
+ WIN_32: "win32",
11
+ WIN_64: "win64",
12
+ };
13
+
14
+ Object.freeze(Platform);
15
+
16
+ export default Platform;
@@ -0,0 +1,143 @@
1
+ import semver from "semver";
2
+
3
+ const Platforms = {
4
+ win32: {
5
+ needsZip: true,
6
+ getRunnable: function () {
7
+ return "nw.exe";
8
+ },
9
+ files: {
10
+ // First file must be the executable
11
+ "<=0.9.2": [
12
+ "nw.exe",
13
+ "ffmpegsumo.dll",
14
+ "icudt.dll",
15
+ "libEGL.dll",
16
+ "libGLESv2.dll",
17
+ "nw.pak",
18
+ ],
19
+ ">0.9.2 <0.12.0": [
20
+ "nw.exe",
21
+ "ffmpegsumo.dll",
22
+ "icudtl.dat",
23
+ "libEGL.dll",
24
+ "libGLESv2.dll",
25
+ "nw.pak",
26
+ "locales",
27
+ ],
28
+ ">=0.12.0": [
29
+ "nw.exe",
30
+ "ffmpegsumo.dll",
31
+ "icudtl.dat",
32
+ "libEGL.dll",
33
+ "libGLESv2.dll",
34
+ "nw.pak",
35
+ "locales",
36
+ "d3dcompiler_47.dll",
37
+ "pdf.dll",
38
+ ],
39
+ },
40
+ versionNameTemplate: "v${ version }/${ name }-v${ version }-win-ia32.zip",
41
+ },
42
+ win64: {
43
+ needsZip: true,
44
+ getRunnable: function () {
45
+ return "nw.exe";
46
+ },
47
+ files: {
48
+ // First file must be the executable
49
+ "<=0.9.2": [
50
+ "nw.exe",
51
+ "ffmpegsumo.dll",
52
+ "icudt.dll",
53
+ "libEGL.dll",
54
+ "libGLESv2.dll",
55
+ "nw.pak",
56
+ "locales",
57
+ ],
58
+ ">0.9.2 <0.12.0": [
59
+ "nw.exe",
60
+ "ffmpegsumo.dll",
61
+ "icudtl.dat",
62
+ "libEGL.dll",
63
+ "libGLESv2.dll",
64
+ "nw.pak",
65
+ "locales",
66
+ ],
67
+ ">=0.12.0": [
68
+ "nw.exe",
69
+ "ffmpegsumo.dll",
70
+ "icudtl.dat",
71
+ "libEGL.dll",
72
+ "libGLESv2.dll",
73
+ "nw.pak",
74
+ "locales",
75
+ "d3dcompiler_47.dll",
76
+ "pdf.dll",
77
+ ],
78
+ },
79
+ versionNameTemplate: "v${ version }/${ name }-v${ version }-win-x64.zip",
80
+ },
81
+ osx32: {
82
+ needsZip: false,
83
+ getRunnable: function (version) {
84
+ if (semver.satisfies(version, ">=0.12.0 || ~0.12.0-alpha")) {
85
+ return "nwjs.app/Contents/MacOS/nwjs";
86
+ } else {
87
+ return "node-webkit.app/Contents/MacOS/node-webkit";
88
+ }
89
+ },
90
+ files: {
91
+ "<0.12.0-alpha": ["node-webkit.app"],
92
+ ">=0.12.0 || ~0.12.0-alpha": ["nwjs.app"],
93
+ },
94
+ versionNameTemplate: "v${ version }/${ name }-v${ version }-osx-ia32.zip",
95
+ },
96
+ osx64: {
97
+ needsZip: false,
98
+ getRunnable: function (version) {
99
+ if (semver.satisfies(version, ">=0.12.0 || ~0.12.0-alpha")) {
100
+ return "nwjs.app/Contents/MacOS/nwjs";
101
+ } else {
102
+ return "node-webkit.app/Contents/MacOS/node-webkit";
103
+ }
104
+ },
105
+ files: {
106
+ "<0.12.0-alpha": ["node-webkit.app"],
107
+ ">=0.12.0 || ~0.12.0-alpha": ["nwjs.app"],
108
+ },
109
+ versionNameTemplate: "v${ version }/${ name }-v${ version }-osx-x64.zip",
110
+ },
111
+ linux32: {
112
+ needsZip: true,
113
+ chmod: "0755",
114
+ getRunnable: function () {
115
+ return "nw";
116
+ },
117
+ files: {
118
+ // First file must be the executable
119
+ "<=0.9.2": ["nw", "nw.pak", "libffmpegsumo.so"],
120
+ ">0.9.2 <=0.10.1": ["nw", "nw.pak", "libffmpegsumo.so", "icudtl.dat"],
121
+ ">0.10.1": ["nw", "nw.pak", "libffmpegsumo.so", "icudtl.dat", "locales"],
122
+ },
123
+ versionNameTemplate:
124
+ "v${ version }/${ name }-v${ version }-linux-ia32.tar.gz",
125
+ },
126
+ linux64: {
127
+ needsZip: true,
128
+ chmod: "0755", // chmod file file to be executable
129
+ getRunnable: function () {
130
+ return "nw";
131
+ },
132
+ files: {
133
+ // First file must be the executable
134
+ "<=0.9.2": ["nw", "nw.pak", "libffmpegsumo.so"],
135
+ ">0.9.2 <=0.10.1": ["nw", "nw.pak", "libffmpegsumo.so", "icudtl.dat"],
136
+ ">0.10.1": ["nw", "nw.pak", "libffmpegsumo.so", "icudtl.dat", "locales"],
137
+ },
138
+ versionNameTemplate:
139
+ "v${ version }/${ name }-v${ version }-linux-x64.tar.gz",
140
+ },
141
+ };
142
+
143
+ export default Platforms;
@@ -0,0 +1,7 @@
1
+ import Platform from "./Platform";
2
+ import Platforms from "./Platforms";
3
+
4
+ export {
5
+ Platform,
6
+ Platforms,
7
+ };
package/src/index.js ADDED
@@ -0,0 +1,2 @@
1
+ export { Platform, Platforms } from "./constants";
2
+ export { detectCurrentPlatform, checkCache } from "./utilities";
@@ -0,0 +1,30 @@
1
+ import fs from "fs";
2
+ import path from "path";
3
+
4
+ /**
5
+ *
6
+ * @param {string} filePath
7
+ * @param {string[]} files
8
+ * @returns {boolean}
9
+ */
10
+ const checkCache = (filePath, files) => {
11
+ let missing = false;
12
+
13
+ // If NW.js is above v0.12.3, then we don't know which files we want from the archives. So just check that the folder exists and has at least 3 files in it.
14
+ if (files.length === 1 && files[0] === "*") {
15
+ return fs.existsSync(filePath) && fs.readdirSync(filePath).length >= 2;
16
+ }
17
+
18
+ for (let file of files) {
19
+ if (missing) {
20
+ return false;
21
+ }
22
+ if (!fs.existsSync(path.join(filePath, file))) {
23
+ missing = true;
24
+ }
25
+ }
26
+
27
+ return !missing;
28
+ };
29
+
30
+ export default checkCache;
@@ -0,0 +1,24 @@
1
+ import { Platform } from "../constants";
2
+ /**
3
+ *
4
+ * @param {NodeJS.Process} process
5
+ * @returns {Platform | undefined}
6
+ */
7
+ const detectCurrentPlatform = (process) => {
8
+ switch (process.platform) {
9
+ case "darwin":
10
+ return process.arch === "x64" ? Platform.OSX_64 : Platform.OSX_32;
11
+
12
+ case "win32":
13
+ return process.arch === "x64" || process.env.PROCESSOR_ARCHITEW6432
14
+ ? Platform.WIN_64
15
+ : Platform.WIN_32;
16
+
17
+ case "linux":
18
+ return process.arch === "x64" ? Platform.NIX_64 : Platform.NIX_32;
19
+ default:
20
+ return undefined;
21
+ }
22
+ };
23
+
24
+ export default detectCurrentPlatform;
@@ -0,0 +1,4 @@
1
+ import checkCache from "./checkCache";
2
+ import detectCurrentPlatform from "./detectCurrentPlatform";
3
+
4
+ export { detectCurrentPlatform, checkCache };
File without changes
File without changes
@@ -0,0 +1,14 @@
1
+ const NwBuilder = require("../../lib/index.cjs");
2
+
3
+ const nw = new NwBuilder({
4
+ version: "0.64.1",
5
+ files: "./**",
6
+ macIcns: "./icon.icns",
7
+ macPlist: { mac_bundle_id: "myPkg" },
8
+ });
9
+
10
+ nw.on("log", (msg) => console.log("nw-builder", msg));
11
+
12
+ nw.run()
13
+ .then(() => process.exit(0))
14
+ .catch((error) => console.log(error));
@@ -0,0 +1,10 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>NW Repro</title>
5
+ </head>
6
+
7
+ <body>
8
+ Hello, World!
9
+ </body>
10
+ </html>
@@ -1,12 +1,13 @@
1
1
  {
2
- "main": "index.html",
3
2
  "name": "nw-demo",
4
- "description": "demo app of NW.js",
5
3
  "version": "0.1.0",
6
- "keywords": [ "demo", "NW.js" ],
4
+ "description": "NW.js demo",
5
+ "main": "./index.html",
6
+ "scripts": {
7
+ "start": "node ./index.cjs"
8
+ },
7
9
  "window": {
8
- "title": "NW.js demo",
9
- "icon": "link.png",
10
+ "title": "NW.js Demo",
10
11
  "toolbar": false,
11
12
  "frame": true,
12
13
  "width": 800,
@@ -20,4 +21,4 @@
20
21
  "webkit": {
21
22
  "plugin": true
22
23
  }
23
- }
24
+ }
@@ -0,0 +1,131 @@
1
+ var test = require("tape"),
2
+ nock = require("nock"),
3
+ temp = require("temp"),
4
+ path = require("path"),
5
+ fs = require("fs");
6
+
7
+ temp.track();
8
+
9
+ var downloader = require("../lib/downloader.cjs");
10
+ var fixturesZip = "./test/fixtures/test.zip";
11
+ var fixturesZipStrip = "./test/fixtures/test-strip.zip";
12
+ var fixturesTar = "./test/fixtures/test.tar.gz";
13
+ var isWindows = process.platform === "win32";
14
+
15
+ test("downloadAndUnpack: zip", function (t) {
16
+ t.plan(isWindows ? 3 : 6);
17
+ nock("https://amazon.s3.nw.com")
18
+ .get("/test.zip")
19
+ .replyWithFile(200, fixturesZip);
20
+ temp.mkdir("tmpcache", function (err, dirPath) {
21
+ downloader
22
+ .downloadAndUnpack(dirPath, "https://amazon.s3.nw.com/test.zip")
23
+ .then(function (files) {
24
+ files.forEach(function (file) {
25
+ t.ok(
26
+ fs.existsSync(path.join(dirPath, file.path)),
27
+ file.path + " unpacked",
28
+ );
29
+ });
30
+
31
+ if (!isWindows) {
32
+ t.ok(
33
+ fs.statSync(path.join(dirPath, "file1")).mode.toString(8) == 100444,
34
+ "444 file permission",
35
+ );
36
+ t.ok(
37
+ fs.statSync(path.join(dirPath, "file2")).mode.toString(8) == 100666,
38
+ "666 file permission",
39
+ );
40
+ t.ok(
41
+ fs.statSync(path.join(dirPath, "file3")).mode.toString(8) == 100644,
42
+ "644 file permission",
43
+ ); // DOES NOT WORK ON WINDOWS
44
+ }
45
+ });
46
+ });
47
+ });
48
+
49
+ test("downloadAndUnpack: zip+strip", function (t) {
50
+ t.plan(isWindows ? 3 : 6);
51
+ nock("https://amazon.s3.nw.com")
52
+ .get("/test-strip.zip")
53
+ .replyWithFile(200, fixturesZipStrip);
54
+ temp.mkdir("tmpcache", function (err, dirPath) {
55
+ downloader
56
+ .downloadAndUnpack(dirPath, "https://amazon.s3.nw.com/test-strip.zip")
57
+ .then(function (files) {
58
+ files.forEach(function (file) {
59
+ t.ok(
60
+ fs.existsSync(path.join(dirPath, file.path)),
61
+ file.path + " unpacked",
62
+ );
63
+ });
64
+
65
+ if (!isWindows) {
66
+ t.ok(
67
+ fs.statSync(path.join(dirPath, "file1")).mode.toString(8) == 100444,
68
+ "444 file permission",
69
+ );
70
+ t.ok(
71
+ fs.statSync(path.join(dirPath, "file2")).mode.toString(8) == 100666,
72
+ "666 file permission",
73
+ );
74
+ t.ok(
75
+ fs.statSync(path.join(dirPath, "file3")).mode.toString(8) == 100644,
76
+ "644 file permission",
77
+ ); // DOES NOT WORK ON WINDOWS
78
+ }
79
+ });
80
+ });
81
+ });
82
+
83
+ test("downloadAndUnpack: tar", function (t) {
84
+ t.plan(isWindows ? 3 : 6);
85
+ nock("https://amazon.s3.nw.com")
86
+ .get("/test.tar.gz")
87
+ .replyWithFile(200, fixturesTar);
88
+ temp.mkdir("tmpcache", function (err, dirPath) {
89
+ downloader
90
+ .downloadAndUnpack(dirPath, "https://amazon.s3.nw.com/test.tar.gz")
91
+ .then(function (files) {
92
+ files.forEach(function (file) {
93
+ t.ok(
94
+ fs.existsSync(path.join(dirPath, file.path)),
95
+ file.path + " unpacked",
96
+ );
97
+ });
98
+
99
+ if (!isWindows) {
100
+ t.ok(
101
+ fs.statSync(path.join(dirPath, "file1")).mode.toString(8) == 100444,
102
+ "444 file permission",
103
+ ); // DOES NOT WORK ON WINDOWS
104
+ t.ok(
105
+ fs.statSync(path.join(dirPath, "file2")).mode.toString(8) == 100666,
106
+ "666 file permission",
107
+ );
108
+ t.ok(
109
+ fs.statSync(path.join(dirPath, "file3")).mode.toString(8) == 100644,
110
+ "644 file permission",
111
+ ); // DOES NOT WORK ON WINDOWS
112
+ }
113
+ });
114
+ });
115
+ });
116
+
117
+ test("Should throw an error if you try to download a file that is not available", function (t) {
118
+ t.plan(2);
119
+ nock("https://doesnot.com").get("/exist.zip").reply(404);
120
+ downloader
121
+ .downloadAndUnpack("/", "https://doesnot.com/exist.zip")
122
+ .catch(function (err) {
123
+ t.equal(err.statusCode, 404, err.msg);
124
+ });
125
+ nock("https://doesnot.com").get("/exist.tar").reply(404);
126
+ downloader
127
+ .downloadAndUnpack("/", "https://doesnot.com/exist.tar")
128
+ .catch(function (err) {
129
+ t.equal(err.statusCode, 404, err.msg);
130
+ });
131
+ });
@@ -4,4 +4,4 @@ Files in this directory represent the expected outcomes for certain scenarios. H
4
4
 
5
5
  ## See something which could be improved?
6
6
 
7
- Great, see [CONTRIBUTING.md](../../CONTRIBUTING.md).
7
+ Great, see [CONTRIBUTING.md](../../CONTRIBUTING.md).
@@ -1 +1 @@
1
- imagefilejsfile
1
+ imagefilejsfile
@@ -4,4 +4,4 @@ Files in this directory represent the expected outcomes for certain scenarios. H
4
4
 
5
5
  ## See something which could be improved?
6
6
 
7
- Great, see [CONTRIBUTING.md](../../../CONTRIBUTING.md).
7
+ Great, see [CONTRIBUTING.md](../../../CONTRIBUTING.md).
@@ -1,9 +1,9 @@
1
1
  {
2
- "name": "nw-demo",
3
- "version": "0.1.0",
4
- "main": "index.html",
5
- "window": {
6
- "frame": true,
7
- "toolbar": false
8
- }
2
+ "name": "nw-demo",
3
+ "version": "0.1.0",
4
+ "main": "index.html",
5
+ "window": {
6
+ "frame": true,
7
+ "toolbar": false
8
+ }
9
9
  }
@@ -1,9 +1,9 @@
1
1
  {
2
- "name": "nw-demo",
3
- "version": "0.1.0",
4
- "main": "index.html",
5
- "window": {
6
- "frame": true,
7
- "toolbar": false
8
- }
2
+ "name": "nw-demo",
3
+ "version": "0.1.0",
4
+ "main": "index.html",
5
+ "window": {
6
+ "frame": true,
7
+ "toolbar": false
8
+ }
9
9
  }
@@ -4,4 +4,4 @@ Files in this directory represent the expected outcomes for certain scenarios. H
4
4
 
5
5
  ## See something which could be improved?
6
6
 
7
- Great, see [CONTRIBUTING.md](../../../CONTRIBUTING.md).
7
+ Great, see [CONTRIBUTING.md](../../../CONTRIBUTING.md).
@@ -4,4 +4,4 @@ Files in this directory represent the expected outcomes for certain scenarios. H
4
4
 
5
5
  ## See something which could be improved?
6
6
 
7
- Great, see [CONTRIBUTING.md](../../../CONTRIBUTING.md).
7
+ Great, see [CONTRIBUTING.md](../../../CONTRIBUTING.md).
@@ -1,13 +1,13 @@
1
1
  {
2
- "name": "nw-demo",
3
- "version": "0.1.0",
4
- "main": "another.html",
5
- "window": {
6
- "frame": true,
7
- "toolbar": false
8
- },
9
- "frame": false,
10
- "x": {},
11
- "abc": [],
12
- "def": {}
13
- }
2
+ "name": "nw-demo",
3
+ "version": "0.1.0",
4
+ "main": "another.html",
5
+ "window": {
6
+ "frame": true,
7
+ "toolbar": false
8
+ },
9
+ "frame": false,
10
+ "x": {},
11
+ "abc": [],
12
+ "def": {}
13
+ }
@@ -1,9 +1,9 @@
1
1
  {
2
- "name": "nw-demo",
3
- "version": "0.1.0",
4
- "main": "index.html",
5
- "window": {},
6
- "x": [],
7
- "abc": [],
8
- "def": {}
9
- }
2
+ "name": "nw-demo",
3
+ "version": "0.1.0",
4
+ "main": "index.html",
5
+ "window": {},
6
+ "x": [],
7
+ "abc": [],
8
+ "def": {}
9
+ }