...

Source file src/edge-infra.dev/pkg/tools/vset/start.go

Documentation: edge-infra.dev/pkg/tools/vset

     1  package vset
     2  
     3  import (
     4  	"flag"
     5  	"fmt"
     6  	"os"
     7  )
     8  
     9  var (
    10  	path       string
    11  	goLintPath string
    12  )
    13  
    14  // The Start() function validates the input path and updates it to point to the .vscode directory.
    15  func Start() {
    16  	flag.StringVar(&path, "p", "", "Provide a path to your repo, I.E. just vset <repo-path>")
    17  	flag.Parse()
    18  
    19  	// If the -p flag was not passed, exit the program.
    20  	if path == "" {
    21  		fmt.Println("Please provide the path to your repo.")
    22  		os.Exit(1)
    23  	}
    24  
    25  	path, err := Update(path)
    26  	if err != nil {
    27  		fmt.Println(err)
    28  		os.Exit(1)
    29  	}
    30  	fmt.Println("Configuring settings.json...")
    31  	if err := Configurator(path, goLintPath); err != nil {
    32  		fmt.Println(err)
    33  		os.Exit(1)
    34  	}
    35  }
    36  

View as plain text