@@ -2,11 +2,11 @@ import fs from 'node:fs'
2
2
3
3
import meow from 'meow'
4
4
5
- import type { CliSubcommand } from '../../utils/meow-with-subcommands'
6
5
import { scala } from './scala.ts'
7
6
8
- const description =
9
- 'Auto-detect build and attempt to generate manifest file'
7
+ import type { CliSubcommand } from '../../utils/meow-with-subcommands'
8
+
9
+ const description = 'Auto-detect build and attempt to generate manifest file'
10
10
11
11
const help = ( name : string ) => `
12
12
Usage
@@ -23,14 +23,14 @@ export const auto: CliSubcommand = {
23
23
description,
24
24
async run ( argv , importMeta , { parentName } ) {
25
25
// Allow `--verbose` to pass through
26
- let verbose = false ;
26
+ let verbose = false
27
27
const args = argv . filter ( arg => {
28
28
if ( arg === '--verbose' ) {
29
- verbose = true ;
30
- return false ;
29
+ verbose = true
30
+ return false
31
31
}
32
- return true ;
33
- } ) ;
32
+ return true
33
+ } )
34
34
35
35
const name = `${ parentName } auto`
36
36
if ( args . length ) {
@@ -42,18 +42,21 @@ export const auto: CliSubcommand = {
42
42
} )
43
43
}
44
44
45
- const subArgs = [ ] ;
46
- if ( verbose ) subArgs . push ( '--verbose' , '1' ) ;
47
- const scalaDir = '.' ;
45
+ const subArgs = [ ]
46
+ if ( verbose ) subArgs . push ( '--verbose' , '1' )
47
+ const scalaDir = '.'
48
48
if ( fs . existsSync ( scalaDir ) ) {
49
- console . log ( 'Detected a Scala sbt build, running default Scala generator...' )
49
+ console . log (
50
+ 'Detected a Scala sbt build, running default Scala generator...'
51
+ )
50
52
subArgs . push ( scalaDir )
51
- await scala . run ( subArgs , importMeta , { parentName} )
52
- return ;
53
+ await scala . run ( subArgs , importMeta , { parentName } )
54
+ return
53
55
}
54
56
55
57
// Show new help screen and exit
56
- meow ( `
58
+ meow (
59
+ `
57
60
$ ${ name }
58
61
59
62
Unfortunately this script did not discover a supported language in the
@@ -64,11 +67,12 @@ export const auto: CliSubcommand = {
64
67
- Make sure the necessary build tools are available (\`PATH\`)
65
68
66
69
If that doesn't work, see \`${ name } <lang> --help\` for config details
67
- ` , {
68
- argv : [ '--help' ] ,
69
- description,
70
- importMeta
71
- } )
70
+ ` ,
71
+ {
72
+ argv : [ '--help' ] ,
73
+ description,
74
+ importMeta
75
+ }
76
+ )
72
77
}
73
78
}
74
-
0 commit comments