Skip to content

Commit 8f8b166

Browse files
willveddMichael Christenson II
authored and
Michael Christenson II
committed
DXCDT-400: Allowing piped-in templates into auth0 ul templates update (#950)
Adding piped-in HTML and updated docs
1 parent 1526d5a commit 8f8b166

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

docs/auth0_universal-login_templates_update.md

+2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ auth0 universal-login templates update [flags]
1717
```
1818
auth0 universal-login templates update
1919
auth0 ul templates update
20+
cat login.liquid | auth0 ul templates update
21+
echo "<html>{%- auth0:head -%}{%- auth0:widget -%}</html>" | auth0 ul templates update
2022
```
2123

2224

internal/cli/universal_login_templates.go

+9-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import (
2222

2323
"github.com/auth0/auth0-cli/internal/ansi"
2424
"github.com/auth0/auth0-cli/internal/auth0"
25+
"github.com/auth0/auth0-cli/internal/iostream"
2526
"github.com/auth0/auth0-cli/internal/prompt"
2627
)
2728

@@ -136,7 +137,9 @@ func updateBrandingTemplateCmd(cli *cli) *cobra.Command {
136137
Short: "Update the custom template for Universal Login",
137138
Long: "Update the custom template for the New Universal Login Experience.",
138139
Example: ` auth0 universal-login templates update
139-
auth0 ul templates update`,
140+
auth0 ul templates update
141+
cat login.liquid | auth0 ul templates update
142+
echo "<html>{%- auth0:head -%}{%- auth0:widget -%}</html>" | auth0 ul templates update`,
140143
RunE: func(cmd *cobra.Command, args []string) error {
141144
ctx := cmd.Context()
142145

@@ -161,6 +164,11 @@ func updateBrandingTemplateCmd(cli *cli) *cobra.Command {
161164
templateData.Body = templateOptions.getValue(templateData.Body)
162165
}
163166

167+
pipedTemplateHTML := iostream.PipedInput()
168+
if len(pipedTemplateHTML) > 0 {
169+
templateData.Body = string(pipedTemplateHTML)
170+
}
171+
164172
if err := cli.editTemplateAndPreviewChanges(ctx, cmd, templateData); err != nil {
165173
return fmt.Errorf("failed to edit the template and preview the changes: %w", err)
166174
}

0 commit comments

Comments
 (0)