Commit 5656b48c authored by Ayush Tiwari's avatar Ayush Tiwari

Add function for revmoving submodule

parent 5983e42e
......@@ -173,7 +173,23 @@ class Recipe(object):
try:
check_call(command, cwd=self.location)
except CalledProcessError, e:
print "Git Reset stdout output:\n", e.output
print "Git Reset stdout output:\n", e.returncode
raise
def gitRemoveSubmodule(self, submodule_path=None):
"""
Cleanly remove submodule
"""
if submodule_path:
# Remove the submodule entry from .git/config
check_call(['git', 'submodule', 'deinit', '-f', submodule_path])
# Remove the submodule directory from the parent's .git/modules directory
check_call(['rm', '-rf', '.git/modules/%s' % submodule_path])
# Remove the entry in .gitmodules and remove the submodule directory
# located at submodule path
check_call(['git', 'rm', '-f', submodule_path])
def install(self):
"""
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment