File tree 1 file changed +9
-3
lines changed
1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -13,16 +13,22 @@ import { limitText } from '../utils'
13
13
function readPackageScripts ( ctx : RunnerContext | undefined ) {
14
14
// support https://www.npmjs.com/package/npm-scripts-info conventions
15
15
const pkg = getPackageJSON ( ctx )
16
- const scripts = pkg . scripts || { }
16
+ const rawScripts = pkg . scripts || { }
17
17
const scriptsInfo = pkg [ 'scripts-info' ] || { }
18
18
19
- return Object . entries ( scripts )
19
+ const scripts = Object . entries ( rawScripts )
20
20
. filter ( i => ! i [ 0 ] . startsWith ( '?' ) )
21
21
. map ( ( [ key , cmd ] ) => ( {
22
22
key,
23
23
cmd,
24
- description : scriptsInfo [ key ] || scripts [ `?${ key } ` ] || cmd ,
24
+ description : scriptsInfo [ key ] || rawScripts [ `?${ key } ` ] || cmd ,
25
25
} ) )
26
+
27
+ if ( scripts . length === 0 && ! ctx ?. programmatic ) {
28
+ console . warn ( 'No scripts found in package.json' )
29
+ }
30
+
31
+ return scripts
26
32
}
27
33
28
34
runCli ( async ( agent , args , ctx ) => {
You can’t perform that action at this time.
0 commit comments