@leverege/build-tools 2.70.4 → 2.80.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leverege/build-tools",
3
- "version": "2.70.4",
3
+ "version": "2.80.0",
4
4
  "description": "A collection of build / support tools for Leverege developers",
5
5
  "main": "index.js",
6
6
  "repository": {
@@ -1,6 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
  import path from 'node:path'
3
- import { $, fs, chalk } from 'zx'
3
+ import { $, fs, chalk, argv } from 'zx'
4
+
5
+ const srcOnly = argv.srcOnly
4
6
 
5
7
  const $$ = $( {
6
8
  stdio : 'inherit'
@@ -31,8 +33,12 @@ async function getLinesOfCodeForDirectory( directory ) {
31
33
  const hasSrc = await fs.exists( srcDir )
32
34
 
33
35
  if ( hasSrc ) {
34
- console.log( `${chalk.greenBright( srcDir )}:` )
35
- await $$`sloc ${srcDir} --format cli-table`
36
+ console.log( `${chalk.greenBright( srcOnly ? srcDir : directory )}:` )
37
+ if ( srcOnly ) {
38
+ await $$`sloc ${srcDir} --format cli-table`
39
+ } else {
40
+ await $$`sloc ${directory} --format cli-table -i '^(src|test)/.*' -e node_modules`
41
+ }
36
42
  } else {
37
43
  console.log( chalk.redBright( `No src directory at ${directory}` ) )
38
44
  }