Bugfix not-needed script argument parsing (#49718)

* fix not-needed script regression, introduced by removing of the sourceRepoURL parameter in #49620 (3868b76e67)

* doc fix example of npm run not-needed
This commit is contained in:
Marko Kaznovac
2020-11-24 01:15:32 +01:00
committed by GitHub
parent 39b243a5f7
commit 87db076e48
2 changed files with 3 additions and 3 deletions

View File

@@ -218,7 +218,7 @@ For a good example package, see [base64-js](https://github.com/DefinitelyTyped/D
When a package [bundles](http://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html) its own types, types should be removed from Definitely Typed to avoid confusion.
You can remove it by running `npm run not-needed typingsPackageName asOfVersion [libraryName]`.
You can remove it by running `npm run not-needed -- typingsPackageName asOfVersion [libraryName]`.
* `typingsPackageName`: This is the name of the directory to delete.
* `asOfVersion`: A stub will be published to `@types/foo` with this version. Should be higher than any currently published version, and should be a version of `foo` on npm.
* `libraryName`: Name of npm package that replaces the Definitely Typed types. Usually this is identical to "typingsPackageName", in which case you can omit it.

View File

@@ -5,9 +5,9 @@ const path = require("path");
const typingsPackageName = process.argv[2];
const asOfVersion = process.argv[3];
const libraryName = process.argv[5] || typingsPackageName;
const libraryName = process.argv[4] || typingsPackageName;
if (process.argv.length !== 5 && process.argv.length !== 6) {
if (process.argv.length !== 4 && process.argv.length !== 5) {
console.log("Usage: npm run not-needed -- typingsPackageName asOfVersion [libraryName]");
process.exit(1);
}