artifactType returns the type of the source's artifact: link for a link, or for a document, the type from --type when typeFlag is set. Without it, a .html or .htm file is an HTML document, and any other document is generic.
(typeFlag string)
| 84 | // or for a document, the type from --type when typeFlag is set. Without it, a |
| 85 | // .html or .htm file is an HTML document, and any other document is generic. |
| 86 | func (s source) artifactType(typeFlag string) string { |
| 87 | switch { |
| 88 | case s.isLink(): |
| 89 | return client.TypeLink |
| 90 | case typeFlag != "": |
| 91 | return typeFlag |
| 92 | case s.kind == fromFile && shared.IsHTMLFile(s.arg): |
| 93 | return client.TypeEmbeddedHTML |
| 94 | } |
| 95 | return client.TypeGeneric |
| 96 | } |
| 97 | |
| 98 | // NewCmdCreate creates the gh issue artifact create command. |
| 99 | func NewCmdCreate(f *cmdutil.Factory, telemetry ghtelemetry.InvocationRecorder, runF func(*CreateOptions) error) *cobra.Command { |
no test coverage detected