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 (
2222
2323func usage () {
2424 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.
2627
2728When LGTM_SRC is not set, the script installs dependencies as described below, and then invokes the
2829extractor in the working directory.
@@ -601,12 +602,7 @@ func extract(depMode DependencyInstallerMode, modMode ModMode) {
601602 }
602603}
603604
604- func main () {
605- if len (os .Args ) > 1 {
606- usage ()
607- os .Exit (2 )
608- }
609-
605+ func installDependenciesAndBuild () {
610606 log .Printf ("Autobuilder was built with %s, environment has %s\n " , runtime .Version (), getEnvGoVersion ())
611607
612608 srcdir := getSourceDir ()
@@ -692,3 +688,18 @@ func main() {
692688
693689 extract (depMode , modMode )
694690}
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