File tree Expand file tree Collapse file tree 3 files changed +11
-4
lines changed Expand file tree Collapse file tree 3 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -35,3 +35,4 @@ The `pm-x` generator generates commands for running/executing a package through
35
35
- ` name ` : The package name (by default tries to read from the ` name ` field in ` package.json ` ).
36
36
- ` separate ` : Separate code blocks for each package manager (defaults to ` false ` ).
37
37
- ` args ` : An additional string appended at the end of each command suggesting arguments to be used with the program. (defaults to ` "" ` ).
38
+ - ` version ` : Show version in exec command
Original file line number Diff line number Diff line change @@ -64,9 +64,15 @@ export const pmX = defineGenerator({
64
64
} ;
65
65
}
66
66
67
+ let versionSuffix = "" ;
68
+ if ( args . version ) {
69
+ versionSuffix =
70
+ typeof args . version === "string" ? `@${ args . version } ` : `@${ version } ` ;
71
+ }
72
+
67
73
const contents = RUN_COMMANDS . map (
68
74
( [ pm , cmd ] ) =>
69
- `# ${ pm } \n${ cmd } ${ name } @ ${ version ? ` ${ version } ` : "" } ${ args . args ? ` ${ args . args } ` : "" } ` ,
75
+ `# ${ pm } \n${ cmd } ${ name } ${ versionSuffix } ${ args . args ? ` ${ args . args } ` : "" } ` ,
70
76
) ;
71
77
72
78
if ( ( args . separate ?? false ) === false ) {
Original file line number Diff line number Diff line change 17
17
18
18
``` sh
19
19
# npm
20
- npx automd@0.3.4 .
20
+ npx automd .
21
21
22
22
# pnpm
23
- pnpm dlx automd@0.3.4 .
23
+ pnpm dlx automd .
24
24
25
25
# bun
26
- bunx automd@0.3.4 .
26
+ bunx automd .
27
27
```
28
28
29
29
<!-- /automd -->
You can’t perform that action at this time.
0 commit comments