Skip to content

Commit 7114c69

Browse files
Add config alias; add base_url override warning (#89)
* Add config alias * Add base_url override warning
1 parent 4c63966 commit 7114c69

File tree

4 files changed

+16
-9
lines changed

4 files changed

+16
-9
lines changed

Diff for: README.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -97,21 +97,21 @@ For lessons with HTTP tests, you can configure the CLI with a base URL that over
9797
- To set the base URL run:
9898

9999
```bash
100-
bootdev configure base_url <url>
100+
bootdev config base_url <url>
101101
```
102102

103103
*Make sure you include the protocol scheme (`http://`) in the URL.*
104104

105105
- To get the current base URL (the default is an empty string), run:
106106

107107
```bash
108-
bootdev configure base_url
108+
bootdev config base_url
109109
```
110110

111111
- To reset the base URL and revert to using the lessons' defaults, run:
112112

113113
```bash
114-
bootdev configure base_url --reset
114+
bootdev config base_url --reset
115115
```
116116

117117
### CLI colors
@@ -121,19 +121,19 @@ The CLI text output is rendered with extra colors: green (e.g., success messages
121121
- To customize these colors, run:
122122

123123
```bash
124-
bootdev configure colors --red <value> --green <value> --gray <value>
124+
bootdev config colors --red <value> --green <value> --gray <value>
125125
```
126126

127127
*You can use an [ANSI color code](https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit) or a hex string as the `<value>`.*
128128

129129
- To get the current colors, run:
130130

131131
```bash
132-
bootdev configure colors
132+
bootdev config colors
133133
```
134134

135135
- To reset the colors to their default values, run:
136136

137137
```bash
138-
bootdev configure colors --reset
138+
bootdev config colors --reset
139139
```

Diff for: cmd/configure.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@ import (
1212
// configureCmd represents the configure command which is a container for other
1313
// sub-commands (e.g., colors, base URL override)
1414
var configureCmd = &cobra.Command{
15-
Use: "configure",
16-
Short: "Change configuration of the CLI",
15+
Use: "config",
16+
Aliases: []string{"configure"},
17+
Short: "Change configuration of the CLI",
1718
}
1819

1920
var defaultColors = map[string]string{

Diff for: cmd/submit.go

+6
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package cmd
22

33
import (
44
"errors"
5+
"fmt"
56

67
"github.com/bootdotdev/bootdev/checks"
78
api "github.com/bootdotdev/bootdev/client"
@@ -43,6 +44,11 @@ func submissionHandler(cmd *cobra.Command, args []string) error {
4344

4445
data := lesson.Lesson.LessonDataCLI.CLIData
4546
overrideBaseURL := viper.GetString("override_base_url")
47+
if overrideBaseURL != "" {
48+
fmt.Printf("Using overridden base_url: %v\n", overrideBaseURL)
49+
fmt.Printf("You can reset to the default with `bootdev config base_url --reset`\n\n")
50+
}
51+
4652
results := checks.CLIChecks(data, overrideBaseURL)
4753
if isSubmit {
4854
failure, err := api.SubmitCLILesson(lessonUUID, results)

Diff for: version.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v1.18.0
1+
v1.19.0

0 commit comments

Comments
 (0)