File tree Expand file tree Collapse file tree 1 file changed +18
-7
lines changed Expand file tree Collapse file tree 1 file changed +18
-7
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,8 @@ import (
22
22
23
23
func usage () {
24
24
fmt .Fprintf (os .Stderr ,
25
- `%s is a wrapper script that installs dependencies and calls the extractor.
25
+ `%s is a wrapper script that installs dependencies and calls the extractor, or if '--identify-environment'
26
+ is passed then it produces a file 'environment.json' which specifies what go version is needed.
26
27
27
28
When LGTM_SRC is not set, the script installs dependencies as described below, and then invokes the
28
29
extractor in the working directory.
@@ -601,12 +602,7 @@ func extract(depMode DependencyInstallerMode, modMode ModMode) {
601
602
}
602
603
}
603
604
604
- func main () {
605
- if len (os .Args ) > 1 {
606
- usage ()
607
- os .Exit (2 )
608
- }
609
-
605
+ func installDependenciesAndBuild () {
610
606
log .Printf ("Autobuilder was built with %s, environment has %s\n " , runtime .Version (), getEnvGoVersion ())
611
607
612
608
srcdir := getSourceDir ()
@@ -692,3 +688,18 @@ func main() {
692
688
693
689
extract (depMode , modMode )
694
690
}
691
+
692
+ func identifyEnvironment () {
693
+
694
+ }
695
+
696
+ func main () {
697
+ if len (os .Args ) == 0 {
698
+ installDependenciesAndBuild ()
699
+ } else if len (os .Args ) == 2 && os .Args [1 ] == "--identify-environment" {
700
+ identifyEnvironment ()
701
+ } else {
702
+ usage ()
703
+ os .Exit (2 )
704
+ }
705
+ }
You can’t perform that action at this time.
0 commit comments