1import * as _ from 'lodash-es' 5export const buildScopeCmdHelp = ({actionName, cliDescript, scriptPath}: { 6 actionName: string, cliDescript: Record<string, unknown> | undefined, scriptPath: string, 8 const explainStr = (cliDescript?.cliExplain || '') as string 9 const defaultOpt = (cliDescript?.cliDefaultOpt || epScopes.deployjs) as string 11 const description = explainStr && !explainStr.startsWith('[') 13 : `Run ${actionName} on entrypoints` 15 const cmd = `node ${scriptPath} ${actionName}` 17 if (actionName === 'howimports') { 18 examples = ` # Show how deploy entrypoints import a file (default) 19 ${cmd} path/to/file.mjs 21 # Show how all entrypoints import a file 24 # Show how docker-only entrypoints import a file 26 } else if (actionName === 'diff' || actionName === 'gitlog') { 27 const verb = actionName === 'gitlog' ? 'git log' : 'diff' 28 examples = ` # ${verb} from deployed git sha to HEAD (default) 31 # ${verb} specific range 32 ${cmd} a1b2c3d..HEAD~1 34 # ${verb} only docker entrypoints 37 examples = ` # Run with default scope (${defaultOpt}) 40 # Run on all entrypoints 43 # Run on docker entrypoints only 47 const cliOptA = _.isFunction(cliDescript?.cliOptA) ? (cliDescript!.cliOptA as () => string[])() : cliDescript?.cliOptA as string[] | undefined 50 return `${description}