sync

package
v0.1.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 17, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SyncCmd = &cobra.Command{
	Use:   "sync",
	Short: "sync effx.yaml file(s) to the effx api",
	Long:  `sync effx.yaml file(s) to the effx api`,
	Run: func(cmd *cobra.Command, args []string) {
		if apiKeyString == "" && !isDryRun {
			if apiKeyString = os.Getenv(effxApiKeyName); apiKeyString == "" {
				log.Fatal("api key is required")
			}
		}

		if filePathString == "" && directoryString == "" {
			log.Fatal("-f <file_path> or -d <directory> is required")
		}

		if filePathString != "" && directoryString != "" {
			log.Fatal("-f <file_path> and -d <directory> cannot be used together")
		}

		if filePathString != "" {
			if matched, err := isEffxYaml(filePathString); err != nil {
				log.Fatalf("unexpected error: %v", err)
			} else {
				if matched {
					if err := processFile(filePathString); err != nil {
						log.Fatalf("error: %v", err)
					}
				} else {
					log.Fatalf("file_path %s is invalid", filePathString)
				}
			}
		} else {
			if err := processDirectory(directoryString); err != nil {
				log.Fatalf("error: %v", err)
			}

		}
	},
}

Functions

func Initialize

func Initialize()

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL