shithub: hugo

Download patch

ref: 3aade0897751c194370b49790fdd8f7787cc822b
parent: 0e1bda34c3343c42020f1289f849ccf18c39e603
author: Bjørn Erik Pedersen <[email protected]>
date: Sat Jun 24 05:18:57 EDT 2017

releaser: Improve docs submodule handling

Still not optimal.

--- a/releaser/releaser.go
+++ b/releaser/releaser.go
@@ -142,9 +142,17 @@
 	}
 
 	if r.shouldPrepareVersions() {
-		// Make sure the docs submodule is up to date.
-		if _, err := git("submodule", "update", "--remote", "--merge"); err != nil {
-			return err
+		if newVersion.PatchLevel == 0 {
+			// Make sure the docs submodule is up to date.
+			// TODO(bep) improve this. Maybe it was not such a good idea to do
+			// this in the sobmodule directly.
+			if _, err := git("submodule", "update", "--init"); err != nil {
+				return err
+			}
+			//git submodule update
+			if _, err := git("submodule", "update", "--remote", "--merge"); err != nil {
+				return err
+			}
 		}
 		// TODO(bep) the above may not have changed anything.
 		if _, err := git("commit", "-a", "-m", fmt.Sprintf("%s Update /docs [ci skip]", commitPrefix)); err != nil {