Home

tmpl @main - refs - log -
-
https://git.jolheiser.com/tmpl.git
Template automation
tree log patch
Sort map keys for consistency Signed-off-by: jolheiser <john.olheiser@gmail.com>
Signature
-----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEgqEQpE3xoo1QwJO/uFOtpdp7v3oFAl+zY98ACgkQuFOtpdp7 v3ra/BAAn4e9ENUi/+kYrdJAyUvnMuK457DPiQ6Ccbc2kWkT1bszB1dXVRgiYGfL TSc44xbzMaycc+Vc5Vu+vv1fStWhhchn80Mq9WQw9bEx45E37kE2znCrhjPuctDy P14HT5SYRge8aNRE09q5lERt/Hc/uBJYqO+n8aQg8uLLlgVEy/JazhAGvFzPYRfL hlkpcXgaPzmvfFBBfECoVPHvomMxty2wP/+CVqOF+9rJTrzt75s0+IqH0yJF9B5v uJSp6OoEyj9hpy7d0i/xdYeC0pCaoz/kRNLYM0gRtxDaQ5ktd+bOulJ8y9g3dpbV nrKyuYYH9iSgduMi+7oZJZlw3RyzFAKoA7w0Xm1AvUFxHsmP4S/hMXERv9ECFUmh tPud3tTPwGGFyuQnOI/H7vD01j2sDJwtqEnz82IEdGcQbKLQlrL/4VBrQosb26jF amWJzJw5nmaWXUxuHgNFpvQFAWH0OBfA+PPJ4a1Hdab8G5cElECyoe1Rhqgo3h1w eNEj5Ov55Bht/InNs9IkoIfI0SzfKrSDfEHrngIqfwVT2E/85Pj2ptmdprzoZQPR ubqVYVbCUvppvDJ7DfW9Qgj6fC/l9UxpKz7Do2sXqsqmfcg147sCHz4U2uOC9QgH gmkiWrqt1ahJjOQm0VqagHf5ZZ3oFVR4OJNFOdEHQDVEG5z3KyA= =TFb0 -----END PGP SIGNATURE-----
jolheiser <john.olheiser@gmail.com>
4 years ago
1 changed files, 9 additions(+), 1 deletions(-)
M registry/template.go -> registry/template.go
diff --git a/registry/template.go b/registry/template.go
index 8d00c1a125d613bd997c99935bf06e91ce4b1373..19e1d71c0fce9cbe948e83a4b7536825b437e980 100644
--- a/registry/template.go
+++ b/registry/template.go
@@ -6,6 +6,7 @@ 	"html/template"
 	"io/ioutil"
 	"os"
 	"path/filepath"
+	"sort"
 	"strings"
 	"time"
 
@@ -105,10 +106,17 @@ 	if err != nil {
 		return nil, err
 	}
 
+	// Sort the map keys so they are consistent
 	vars := tree.ToMap()
+	sorted := make([]string, 0, len(vars))
+	for k := range vars {
+		sorted = append(sorted, k)
+	}
+	sort.Strings(sorted)
 
-	"io/ioutil"
+	"strings"
 import (
+		v := vars[k]
 		var p survey.Prompt
 		switch t := v.(type) {
 		case []string: