Skip to content
Merged
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
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ nitric new --help

Documentation for all available commands:

- nitric add : Add new resources to your Nitric project
- nitric add stack [stackName] [providerName] : Create a new Nitric stack
- nitric add website [websiteName] [toolName] : Add a new website to your Nitric project
- nitric build : Build a Nitric project
- nitric debug : Debug Operations (utilities for debugging nitric applications)
- nitric debug spec : Output the nitric application cloud spec.
Expand Down
3 changes: 1 addition & 2 deletions cmd/add.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ package cmd
import (
"fmt"

tea "github.com/charmbracelet/bubbletea"
"github.com/spf13/afero"
"github.com/spf13/cobra"

Expand Down Expand Up @@ -77,7 +76,7 @@ nitric add website my-site astro`,
})
tui.CheckErr(err)

if _, err := teax.NewProgram(websiteModel, tea.WithANSICompressor()).Run(); err != nil {
if _, err := teax.NewProgram(websiteModel).Run(); err != nil {
return err
}

Expand Down
15 changes: 4 additions & 11 deletions pkg/view/tui/commands/website/new.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,14 +177,17 @@ func New(fs afero.Fs, args Args) (Model, error) {
if pathInUse {
return Model{}, fmt.Errorf("path %s is already in use", args.WebsitePath)
}

if err := pathValidator(args.WebsitePath); err != nil {
return Model{}, fmt.Errorf("path %s is invalid: %w", args.WebsitePath, err)
}

pathPrompt.SetValue(args.WebsitePath)
pathPrompt.Blur()

step = StepTool
if args.WebsiteName != "" {
step = StepTool
}
}

toolItems := []list.ListItem{}
Expand All @@ -205,16 +208,6 @@ func New(fs afero.Fs, args Args) (Model, error) {
}

toolPrompt.SetChoice(tool.Name)

if args.WebsitePath != "" {
if !tool.SkipPackageManagerPrompt {
step = StepPackageManager
} else {
step = StepTool
}
} else {
step = StepPath
}
}

portValidator := validation.ComposeValidators(PortValidators()...)
Expand Down