-
Notifications
You must be signed in to change notification settings - Fork 192
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add support for tags and ranges in
prepare
command (#136)
Fixes: #72
- Loading branch information
Showing
2 changed files
with
9 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,6 +24,9 @@ export class PrepareCommand extends Command<Context> { | |
], [ | ||
`Prepare a specific Yarn version`, | ||
`$0 prepare [email protected]`, | ||
], [ | ||
`Prepare the latest available pnpm version`, | ||
`$0 prepare pnpm@latest --activate`, | ||
], [ | ||
`Generate an archive for a specific Yarn version`, | ||
`$0 prepare [email protected] -o`, | ||
|
@@ -50,7 +53,7 @@ export class PrepareCommand extends Command<Context> { | |
tolerateBoolean: true, | ||
}); | ||
|
||
specs = Option.Rest() | ||
specs = Option.Rest(); | ||
|
||
async execute() { | ||
if (this.all && this.specs.length > 0) | ||
|
@@ -79,10 +82,10 @@ export class PrepareCommand extends Command<Context> { | |
|
||
for (const request of specs) { | ||
const spec = typeof request === `string` | ||
? specUtils.parseSpec(request, `CLI arguments`) | ||
? specUtils.parseSpec(request, `CLI arguments`, {enforceExactVersion: false}) | ||
: request; | ||
|
||
const resolved = await this.context.engine.resolveDescriptor(spec); | ||
const resolved = await this.context.engine.resolveDescriptor(spec, {allowTags: true}); | ||
if (resolved === null) | ||
throw new UsageError(`Failed to successfully resolve '${spec.range}' to a valid ${spec.name} release`); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters