summaryrefslogtreecommitdiffstats
path: root/pkg/commands/submodules.go
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2020-10-01 09:04:09 +1000
committerJesse Duffield <jessedduffield@gmail.com>2020-10-02 08:09:42 +1000
commit86dd9d87dd046e09580f0f0caad109c97aa70546 (patch)
tree90f0a4b933545316056d00038d599771f884f422 /pkg/commands/submodules.go
parentda3e00823f733743c2bd8076d13955dbed9fcbae (diff)
allow updating submodule
Diffstat (limited to 'pkg/commands/submodules.go')
-rw-r--r--pkg/commands/submodules.go7
1 files changed, 6 insertions, 1 deletions
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)
+}