()
| 126 | } |
| 127 | |
| 128 | func (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 | } |
no test coverage detected