Skip to content

Commit

Permalink
fix(util): validate options.zip
Browse files Browse the repository at this point in the history
  • Loading branch information
ayushmanchhabra committed Nov 15, 2024
1 parent b7d65c5 commit 9378d6f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,10 @@ export const validate = async (options, releaseInfo) => {
if (semver.parse(options.version).minor >= '83' && options.nativeAddon !== false) {
throw new Error('Native addons are not supported for NW.js v0.82.0 and below');
}

if (typeof options.zip !== "boolean" && options.zip !== "zip" && options.zip !== "tar" && options.zip !== "tgz") {

Check failure on line 425 in src/util.js

View workflow job for this annotation

GitHub Actions / tests (macos-15)

Strings must use singlequote

Check failure on line 425 in src/util.js

View workflow job for this annotation

GitHub Actions / tests (macos-15)

Strings must use singlequote

Check failure on line 425 in src/util.js

View workflow job for this annotation

GitHub Actions / tests (macos-15)

Strings must use singlequote

Check failure on line 425 in src/util.js

View workflow job for this annotation

GitHub Actions / tests (macos-15)

Strings must use singlequote

Check failure on line 425 in src/util.js

View workflow job for this annotation

GitHub Actions / tests (ubuntu-24.04)

Strings must use singlequote

Check failure on line 425 in src/util.js

View workflow job for this annotation

GitHub Actions / tests (ubuntu-24.04)

Strings must use singlequote

Check failure on line 425 in src/util.js

View workflow job for this annotation

GitHub Actions / tests (ubuntu-24.04)

Strings must use singlequote

Check failure on line 425 in src/util.js

View workflow job for this annotation

GitHub Actions / tests (ubuntu-24.04)

Strings must use singlequote

Check failure on line 425 in src/util.js

View workflow job for this annotation

GitHub Actions / tests (windows-2022)

Strings must use singlequote

Check failure on line 425 in src/util.js

View workflow job for this annotation

GitHub Actions / tests (windows-2022)

Strings must use singlequote

Check failure on line 425 in src/util.js

View workflow job for this annotation

GitHub Actions / tests (windows-2022)

Strings must use singlequote

Check failure on line 425 in src/util.js

View workflow job for this annotation

GitHub Actions / tests (windows-2022)

Strings must use singlequote
throw new Error('Expected options.zip to be a boolean, `zip`, `tar` or `tgz`. Got ' + typeof options.zip);
}
}

// TODO: Validate app options
Expand Down

0 comments on commit 9378d6f

Please sign in to comment.