From 86dd9d87dd046e09580f0f0caad109c97aa70546 Mon Sep 17 00:00:00 2001 From: Jesse Duffield Date: Thu, 1 Oct 2020 09:04:09 +1000 Subject: allow updating submodule --- pkg/commands/submodules.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'pkg/commands/submodules.go') diff --git a/pkg/commands/submodules.go b/pkg/commands/submodules.go index 19debf890..1444890f7 100644 --- a/pkg/commands/submodules.go +++ b/pkg/commands/submodules.go @@ -101,7 +101,8 @@ func (c *GitCommand) SubmoduleDelete(submodule *models.SubmoduleConfig) error { } if err := c.OSCommand.RunCommand("git rm --force -r %s", submodule.Path); err != nil { - return err + // if the directory isn't there then that's fine + c.Log.Error(err) } return os.RemoveAll(filepath.Join(c.DotGitDir, "modules", submodule.Path)) @@ -128,3 +129,7 @@ func (c *GitCommand) SubmoduleUpdateUrl(name string, path string, newUrl string) func (c *GitCommand) SubmoduleInit(path string) error { return c.OSCommand.RunCommand("git submodule init %s", path) } + +func (c *GitCommand) SubmoduleUpdate(path string) error { + return c.OSCommand.RunCommand("git submodule update --init %s", path) +} -- cgit v1.2.3