Skip to content

Commit

Permalink
Merge pull request #80 from justinmerrell/user-agent
Browse files Browse the repository at this point in the history
feat: add user agent and fix project example
  • Loading branch information
DireLines authored Feb 1, 2024
2 parents 4c41b0a + ef38812 commit ed59610
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions api/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"encoding/json"
"net/http"
"os"
"runtime"
"time"

"github.com/spf13/viper"
Expand Down Expand Up @@ -33,7 +34,11 @@ func Query(input Input) (res *http.Response, err error) {
if err != nil {
return
}

userAgent := "RunPod-CLI/" + Version + " (" + runtime.GOOS + "; " + runtime.GOARCH + ")"

req.Header.Add("Content-Type", "application/json")
req.Header.Set("User-Agent", userAgent)

client := &http.Client{Timeout: time.Second * 10}
return client.Do(req)
Expand Down
4 changes: 2 additions & 2 deletions cmd/project/project.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ func selectStarterTemplate() (template string, err error) {
options = append(options, StarterTemplateOption{Name: template.Name(), Value: template.Name()})
}
getStarterTemplate := promptui.Select{
Label: "Select a Starter Example:",
Label: "Select a Starter Project:",
Items: options,
Templates: promptTemplates,
}
Expand Down Expand Up @@ -185,7 +185,7 @@ var NewProjectCmd = &cobra.Command{

// Create Project
createNewProject(projectName, cudaVersion, pythonVersion, modelType, modelName, initCurrentDir)
fmt.Printf("\nProject %s created successfully!\n", projectName)
fmt.Printf("\nProject %s created successfully! Run `cd %s` to change directory to your project.\n", projectName, projectName)
fmt.Println("From your project root run `runpodctl project dev` to start a development pod.")
},
}
Expand Down

0 comments on commit ed59610

Please sign in to comment.