MCPcopy
hub / github.com/pquerna/ffjson / Execute

Method Execute

inception/inception.go:128–160  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

126}
127
128func (i *Inception) Execute() {
129 if len(os.Args) != 1 {
130 i.handleError(errors.New(fmt.Sprintf("Internal ffjson error: inception executable takes no args: %v", os.Args)))
131 return
132 }
133
134 err := i.generateCode()
135 if err != nil {
136 i.handleError(err)
137 return
138 }
139
140 data, err := RenderTemplate(i)
141 if err != nil {
142 i.handleError(err)
143 return
144 }
145
146 stat, err := os.Stat(i.InputPath)
147
148 if err != nil {
149 i.handleError(err)
150 return
151 }
152
153 err = ioutil.WriteFile(i.OutputPath, data, stat.Mode())
154
155 if err != nil {
156 i.handleError(err)
157 return
158 }
159
160}

Callers 3

renderTplMethod · 0.80
RenderTemplateFunction · 0.80
tplStrFunction · 0.80

Calls 3

handleErrorMethod · 0.95
generateCodeMethod · 0.95
RenderTemplateFunction · 0.85

Tested by

no test coverage detected