Skip to content

Commit bdc2693

Browse files
authored
Polish changes (#1656)
1 parent 22e2f49 commit bdc2693

File tree

16 files changed

+36
-41
lines changed

16 files changed

+36
-41
lines changed

cli/cmd/delete.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ var _deleteCmd = &cobra.Command{
9595
if err != nil {
9696
exit.Error(err)
9797
}
98-
fmt.Println(string(bytes))
98+
fmt.Print(string(bytes))
9999
return
100100
}
101101

cli/cmd/deploy.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ var _deployCmd = &cobra.Command{
119119
if err != nil {
120120
exit.Error(err)
121121
}
122-
fmt.Println(string(bytes))
122+
fmt.Print(string(bytes))
123123
case flags.MixedOutputType:
124124
err := mixedPrint(deployResults)
125125
if err != nil {

cli/cmd/env.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ var _envListCmd = &cobra.Command{
134134
if err != nil {
135135
exit.Error(err)
136136
}
137-
fmt.Println(string(bytes))
137+
fmt.Print(string(bytes))
138138
return
139139
}
140140

cli/cmd/lib_realtime_apis.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,6 @@ func realtimeAPITable(realtimeAPI schema.APIResponse, env cliconfig.Environment)
6868

6969
out += "\n" + console.Bold("endpoint: ") + realtimeAPI.Endpoint
7070

71-
out += fmt.Sprintf("\n%s curl %s -X POST -H \"Content-Type: application/json\" -d @sample.json\n", console.Bold("example curl:"), realtimeAPI.Endpoint)
72-
7371
if !(realtimeAPI.Spec.Predictor.Type == userconfig.PythonPredictorType && realtimeAPI.Spec.Predictor.ModelPath == nil && realtimeAPI.Spec.Predictor.Models == nil) {
7472
out += "\n" + describeModelInput(realtimeAPI.Status, realtimeAPI.Spec.Predictor, realtimeAPI.Endpoint)
7573
}

cli/cmd/lib_traffic_splitters.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ limitations under the License.
1717
package cmd
1818

1919
import (
20-
"fmt"
2120
"strings"
2221
"time"
2322

@@ -51,7 +50,6 @@ func trafficSplitterTable(trafficSplitter schema.APIResponse, env cliconfig.Envi
5150

5251
out += "\n" + console.Bold("last updated: ") + libtime.SinceStr(&lastUpdated)
5352
out += "\n" + console.Bold("endpoint: ") + trafficSplitter.Endpoint
54-
out += fmt.Sprintf("\n%s curl %s -X POST -H \"Content-Type: application/json\" -d @sample.json\n", console.Bold("example curl:"), trafficSplitter.Endpoint)
5553

5654
out += "\n" + apiHistoryTable(trafficSplitter.APIVersions)
5755

cli/cmd/patch.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ var _patchCmd = &cobra.Command{
8282
if err != nil {
8383
exit.Error(err)
8484
}
85-
fmt.Println(string(bytes))
85+
fmt.Print(string(bytes))
8686
case flags.PrettyOutputType:
8787
message := deployMessage(deployResults, env.Name)
8888
if didAnyResultsError(deployResults) {

cli/cmd/refresh.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ var _refreshCmd = &cobra.Command{
7373
if err != nil {
7474
exit.Error(err)
7575
}
76-
fmt.Println(string(bytes))
76+
fmt.Print(string(bytes))
7777
return
7878
}
7979

cli/cmd/root.go

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,6 @@ func Execute() {
182182

183183
updateRootUsage()
184184

185-
printLeadingNewLine()
186185
_rootCmd.Execute()
187186

188187
exit.Ok()
@@ -250,18 +249,11 @@ func envStringIfNotSpecified(envName string, cmd *cobra.Command) (string, error)
250249
return "", nil
251250
}
252251

253-
func printLeadingNewLine() {
254-
if len(os.Args) == 3 && os.Args[1] == "completion" {
255-
return
256-
}
257-
fmt.Println("")
258-
}
259-
260252
func mixedPrint(a interface{}) error {
261253
jsonBytes, err := libjson.Marshal(a)
262254
if err != nil {
263255
return err
264256
}
265-
fmt.Println(fmt.Sprintf("~~cortex~~%s~~cortex~~", base64.StdEncoding.EncodeToString(jsonBytes)))
257+
fmt.Print(fmt.Sprintf("~~cortex~~%s~~cortex~~", base64.StdEncoding.EncodeToString(jsonBytes)))
266258
return nil
267259
}

dev/deploy_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def predict(self, payload):
3737
return self.model(payload["text"])[0]
3838

3939

40-
api = cx.deploy(
40+
api = cx.create_api(
4141
api_config,
4242
predictor=PythonPredictor,
4343
requirements=["torch", "transformers"],

dev/generate_cli_md.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ for cmd in "${commands[@]}"; do
5757
echo '' >> $out_file
5858
echo "### ${cmd}" >> $out_file
5959
echo '' >> $out_file
60-
echo -n '```text' >> $out_file
60+
echo '```text' >> $out_file
6161
$ROOT/bin/cortex help ${cmd} >> $out_file
6262
echo '```' >> $out_file
6363
done

0 commit comments

Comments
 (0)