mirror of https://github.com/databricks/cli.git
Initial bricks init add to .gitignore
This commit is contained in:
parent
38a9dabcbe
commit
1733c7d11f
|
@ -111,6 +111,21 @@ var initCmd = &cobra.Command{
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Create .gitignore if absent
|
||||||
|
gitIgnoreFile, err := os.OpenFile(fmt.Sprintf("%s/%s", wd, project.GitIgnoreFile),
|
||||||
|
os.O_CREATE|os.O_WRONLY|os.O_APPEND, 0644)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
defer gitIgnoreFile.Close()
|
||||||
|
|
||||||
|
// Append .databricks to the end of .gitignore file
|
||||||
|
_, err = gitIgnoreFile.WriteString("\n/.databricks/")
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
d, err := templates.ReadDir(".")
|
d, err := templates.ReadDir(".")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|
|
@ -24,6 +24,13 @@ const (
|
||||||
// ConfigFile is the name of project configuration file
|
// ConfigFile is the name of project configuration file
|
||||||
const ConfigFile = "databricks.yml"
|
const ConfigFile = "databricks.yml"
|
||||||
|
|
||||||
|
// Cache Dir is the name of the directory with all the state overrides,
|
||||||
|
// cached artifacts and per-user state
|
||||||
|
const CacheDir = ".databricks"
|
||||||
|
|
||||||
|
// Name of the file with regexes that are not to be checked into git
|
||||||
|
const GitIgnoreFile = ".gitignore"
|
||||||
|
|
||||||
type Assertions struct {
|
type Assertions struct {
|
||||||
Groups []string `json:"groups,omitempty"`
|
Groups []string `json:"groups,omitempty"`
|
||||||
Secrets []string `json:"secrets,omitempty"`
|
Secrets []string `json:"secrets,omitempty"`
|
||||||
|
|
Loading…
Reference in New Issue