Skip to content

Commit 79756ed

Browse files
fix(cli): add missing options (#575)
* fix(cli): add missing options * chore(docs): update changelog * feat(config): lint bin, lib, src and test dir * fix(tests): address lint errors
1 parent 3fb8324 commit 79756ed

File tree

6 files changed

+18
-10
lines changed

6 files changed

+18
-10
lines changed

.github/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
77

88
## [Unreleased]
99

10+
## Added
11+
12+
- Added options `buildType`, `macCredits`, `macPlist`, `zip`, `zipOptions` to CLI [#575](https://github.com/nwjs-community/nw-builder/pull/575)
13+
1014
## [3.7.1] - 2022-06-02
1115

1216
## Changed

bin/nwbuild.cjs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,19 +62,24 @@ const options = {
6262
platforms: argv.platforms ? argv.platforms.split(",") : [currentPlatform],
6363
currentPlatform: currentPlatform,
6464
version: argv.version,
65+
macCredits: argv.macCredits || false,
66+
macPlist: argv.macPlist || false,
6567
macIcns: argv.macIcns || false,
6668
winIco: argv.winIco || false,
6769
cacheDir: argv.cacheDir
6870
? path.resolve(process.cwd(), argv.cacheDir)
6971
: path.resolve(__dirname, "..", "cache"),
7072
buildDir: path.resolve(process.cwd(), argv.buildDir),
73+
buildType: argv.buildType || 'default',
7174
forceDownload: argv.forceDownload,
7275
// get all argv arguments after --
7376
argv: process.argv.slice(
7477
process.argv.findIndex(function firstDash(el) {
7578
return el === "--";
7679
}) + 1,
7780
),
81+
zip: argv.zip || null,
82+
zipOptions: argv.zipOptions || null
7883
};
7984

8085
// Initialize Builder

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
},
1919
"scripts": {
2020
"format": "prettier --write ./bin ./lib ./src ./test",
21-
"lint": "eslint ./src",
21+
"lint": "eslint ./bin/**.cjs ./lib/**.cjs ./src/**.js ./test/**.cjs ",
2222
"test": "pnpm test:unit && tape './test/*.cjs'",
2323
"test:unit": "node --experimental-vm-modules node_modules/jest/bin/jest.js",
2424
"demo": "cd ./test/demo && pnpm start",

test/nwBuilder.cjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ test("Should check if we have some files", function (t) {
3434
files: "./test/fixtures/nwapp/**/*",
3535
});
3636

37-
x.checkFiles().then(function (data) {
37+
x.checkFiles().then(function () {
3838
t.deepEqual(x._appPkg, {
3939
name: "nw-demo",
4040
version: "0.1.0",
@@ -52,7 +52,7 @@ test("Should take the option name if provided", function (t) {
5252
appName: "somename",
5353
});
5454

55-
x.checkFiles().then(function (data) {
55+
x.checkFiles().then(function () {
5656
t.equal(x.options.appName, "somename");
5757
});
5858
});
@@ -253,7 +253,7 @@ test("Should find latest version", function (t) {
253253
version: "latest",
254254
});
255255

256-
x.resolveLatestVersion().then(function (data) {
256+
x.resolveLatestVersion().then(function () {
257257
t.ok(semver.valid(x.options.version), "Version: " + x.options.version);
258258
});
259259

test/utils.cjs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ test("getPackageInfo invalid", function (t) {
3232

3333
test("getPackageInfo valid", function (t) {
3434
t.plan(2);
35-
var pkg = utils
35+
utils
3636
.getPackageInfo("./test/fixtures/nwapp/package.json")
3737
.then(function (pkg) {
3838
t.equal(pkg.name, "nw-demo", "get package name");
@@ -154,7 +154,7 @@ test("getFileList", function (t) {
154154
});
155155

156156
utils.getFileList("./test/fixtures/nwapp/images/**").then(
157-
function (data) {},
157+
function () {},
158158
function (error) {
159159
t.equal(
160160
error,
@@ -165,7 +165,7 @@ test("getFileList", function (t) {
165165
);
166166

167167
utils.getFileList("./test/fixtures/nwapp/images/*.js").then(
168-
function (data) {},
168+
function () {},
169169
function (error) {
170170
t.equal(error, "No files matching");
171171
},
@@ -272,7 +272,7 @@ testSetup({
272272
var unzipper = new DecompressZip(nwfile),
273273
unzipDestination = "test/temp/platform-specific-unzipped";
274274

275-
unzipper.on("extract", function (log) {
275+
unzipper.on("extract", function () {
276276
t.equal(
277277
fs
278278
.readFileSync(path.join(unzipDestination, "package.json"))

test/versions.cjs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
var test = require("tape"),
2-
nock = require("nock"),
3-
_ = require("lodash");
2+
nock = require("nock");
43

54
var versions = require("../lib/versions.cjs");
65

0 commit comments

Comments
 (0)