File tree 3 files changed +19
-7
lines changed
3 files changed +19
-7
lines changed Original file line number Diff line number Diff line change @@ -52,12 +52,16 @@ func main() {
52
52
53
53
heading := GetFirstHeading (string (readme ))
54
54
55
- Choices = append (Choices , heading )
55
+ Choices = append (Choices , Template {
56
+ Name : heading ,
57
+ Path : f .Name (),
58
+ })
59
+
56
60
}
57
61
58
62
choiceModel := ChoiceModel ()
59
63
60
- if m , ok := choiceModel .(OptionStruct ); ok && m .choice != "" {
61
- Copy (m .choice , project )
64
+ if m , ok := choiceModel .(OptionStruct ); ok && m .choice . Path != "" {
65
+ Copy (m .choice . Path , project )
62
66
}
63
67
}
Original file line number Diff line number Diff line change @@ -8,11 +8,16 @@ import (
8
8
tea "github.com/charmbracelet/bubbletea"
9
9
)
10
10
11
- var Choices = []string {}
11
+ type Template struct {
12
+ Name string
13
+ Path string
14
+ }
15
+
16
+ var Choices = []Template {}
12
17
13
18
type OptionStruct struct {
14
19
cursor int
15
- choice string
20
+ choice Template
16
21
}
17
22
18
23
func (m OptionStruct ) Init () tea.Cmd {
@@ -57,7 +62,7 @@ func (m OptionStruct) View() string {
57
62
} else {
58
63
s .WriteString ("[ ] " )
59
64
}
60
- s .WriteString (Choices [i ])
65
+ s .WriteString (Choices [i ]. Name )
61
66
s .WriteString ("\n " )
62
67
}
63
68
Original file line number Diff line number Diff line change @@ -91,9 +91,12 @@ func PkgInstallCommand(manager string) string {
91
91
func Copy (dir , project string ) {
92
92
os .Rename (".disploy/create-disploy-app-main/assets/" + dir , project )
93
93
94
+ if strings .Contains (project , "framework" ) {
95
+ WriteToJson (project + "/disploy.json" , "name" , project )
96
+ }
97
+
94
98
if ! strings .Contains (project , "deno" ) {
95
99
WriteToJson (project + "/package.json" , "name" , project )
96
- WriteToJson (project + "/disploy.json" , "name" , project )
97
100
98
101
m , ok := PackageManagerChoiceModel ().(PackageManagerOptionStruct )
99
102
You can’t perform that action at this time.
0 commit comments