Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix some typos in cli #951

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cli/analytics.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ func redactStepInputs(environment map[string]string, inputs []models.Environment
redactedStepInputs := make(map[string]string)
redactedOriginalInputs := map[string]string{}

// Filter inputs from enviroments
// Filter inputs from environments
for _, input := range inputs {
inputKey, originalValue, err := input.GetKeyValuePair()
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions cli/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const (

ConfigKey = "config"
InventoryKey = "inventory"
OuputFormatKey = "format"
OutputFormatKey = "format"
)

var (
Expand Down Expand Up @@ -63,7 +63,7 @@ var (
cli.StringFlag{Name: PRReadyStateKey, Usage: "Git pull request ready state. Options: ready_for_review draft converted_to_ready_for_review"},
cli.StringFlag{Name: TagKey, Usage: "Git tag name."},

cli.StringFlag{Name: OuputFormatKey, Usage: "Output format. Accepted: json, yml."},
cli.StringFlag{Name: OutputFormatKey, Usage: "Output format. Accepted: json, yml."},

// cli params used in CI mode
cli.StringFlag{Name: JSONParamsKey, Usage: "Specify command flags with json string-string hash."},
Expand Down
10 changes: 5 additions & 5 deletions cli/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ const (
MinimalModeKey = "minimal"
FullModeKey = "full"

ouputFormatKeyShort = "f"
OuputPathKey = "outpath"
outputFormatKeyShort = "f"
OutputPathKey = "outpath"
PrettyFormatKey = "pretty"

IDKey = "id"
Expand Down Expand Up @@ -72,7 +72,7 @@ var (
}
// Command flags
flOutputFormat = cli.StringFlag{
Name: OuputFormatKey + ", " + ouputFormatKeyShort,
Name: OutputFormatKey + ", " + outputFormatKeyShort,
Usage: "Output format. Accepted: raw (default), json, yml",
}
flCollection = cli.StringFlag{
Expand All @@ -99,11 +99,11 @@ var (

// Export
flFormat = cli.StringFlag{
Name: OuputFormatKey,
Name: OutputFormatKey,
Usage: "Output format. Accepted: json, yml.",
}
flOutputPath = cli.StringFlag{
Name: OuputPathKey,
Name: OutputPathKey,
Usage: "Output path, where the exported file will be saved.",
}
flPretty = cli.BoolFlag{
Expand Down
2 changes: 1 addition & 1 deletion cli/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ func processArgs(c *cli.Context) (*RunConfig, error) {
return nil, fmt.Errorf("failed to check Secret Envs Filtering mode: %s", err)
}

noOutputTimeout := readNoOutputTimoutConfiguration(inventoryEnvironments)
noOutputTimeout := readNoOutputTimeoutConfiguration(inventoryEnvironments)

return &RunConfig{
Modes: models.WorkflowRunModes{
Expand Down
6 changes: 3 additions & 3 deletions cli/run_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
envmanModels "github.com/bitrise-io/envman/models"
)

func getNoOutputTimoutValue(inventoryEnvironments []envmanModels.EnvironmentItemModel) (string, error) {
func getNoOutputTimeoutValue(inventoryEnvironments []envmanModels.EnvironmentItemModel) (string, error) {
for _, env := range inventoryEnvironments {
key, value, err := env.GetKeyValuePair()
if err != nil {
Expand All @@ -25,9 +25,9 @@ func getNoOutputTimoutValue(inventoryEnvironments []envmanModels.EnvironmentItem
return os.Getenv(configs.NoOutputTimeoutEnvKey), nil
}

func readNoOutputTimoutConfiguration(inventoryEnvironments []envmanModels.EnvironmentItemModel) time.Duration {
func readNoOutputTimeoutConfiguration(inventoryEnvironments []envmanModels.EnvironmentItemModel) time.Duration {
const defaultTimeout = -1
envVal, err := getNoOutputTimoutValue(inventoryEnvironments)
envVal, err := getNoOutputTimeoutValue(inventoryEnvironments)
if err != nil {
log.Errorf("Failed to read value of %s: %s", configs.NoOutputTimeoutEnvKey, err)
return defaultTimeout
Expand Down
8 changes: 4 additions & 4 deletions cli/run_trigger_params_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func TestParseRunAndTriggerJSONParams(t *testing.T) {
PRReadyStateKey: models.PullRequestReadyStateReadyForReview,
TagKey: "0.9.0",

OuputFormatKey: "json",
OutputFormatKey: "json",

ConfigKey: "bitrise.yml",
ConfigBase64Key: toBase64("bitrise.yml"),
Expand Down Expand Up @@ -163,7 +163,7 @@ func TestParseRunAndTriggerParams(t *testing.T) {
PRTargetBranchKey: prTargetBranch,
PRReadyStateKey: prReadyState,
TagKey: tag,
OuputFormatKey: format,
OutputFormatKey: format,

ConfigKey: bitriseConfigPath,
ConfigBase64Key: bitriseConfigBase64Data,
Expand Down Expand Up @@ -223,7 +223,7 @@ func TestParseRunAndTriggerParams(t *testing.T) {
PRTargetBranchKey: prTargetBranch,
PRReadyStateKey: prReadyState,
TagKey: tag,
OuputFormatKey: format,
OutputFormatKey: format,

ConfigKey: bitriseConfigPath,
ConfigBase64Key: bitriseConfigBase64Data,
Expand Down Expand Up @@ -283,7 +283,7 @@ func TestParseRunAndTriggerParams(t *testing.T) {
PRTargetBranchKey: prTargetBranch,
PRReadyStateKey: prReadyState,
TagKey: tag,
OuputFormatKey: format,
OutputFormatKey: format,

ConfigKey: bitriseConfigPath,
ConfigBase64Key: bitriseConfigBase64Data,
Expand Down
2 changes: 1 addition & 1 deletion cli/trigger_check.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ func triggerCheck(c *cli.Context) error {
jsonParams := c.String(JSONParamsKey)
jsonParamsBase64 := c.String(JSONParamsBase64Key)

format := c.String(OuputFormatKey)
format := c.String(OutputFormatKey)

triggerParams, err := parseTriggerCheckParams(
triggerPattern,
Expand Down
2 changes: 1 addition & 1 deletion cli/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ func validate(c *cli.Context) error {
inventoryBase64Data := c.String(InventoryBase64Key)
inventoryPath := c.String(InventoryKey)

format := c.String(OuputFormatKey)
format := c.String(OutputFormatKey)
if format == "" {
format = output.FormatRaw
}
Expand Down