Skip to content
This repository has been archived by the owner on Jun 7, 2023. It is now read-only.

Commit

Permalink
Pulling updates if folder already exists
Browse files Browse the repository at this point in the history
  • Loading branch information
botherder committed Nov 12, 2019
1 parent 60fa87f commit 0f727f6
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions viper/core/ui/cmd/update-modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,18 @@ def run(self, *args):
self.log("info", "Updating modules...")

dot_viper = os.path.join(os.path.expanduser("~"), ".viper")
# Clone the repository.
p = subprocess.Popen(["git", "clone", "git@github.com:viper-framework/viper-modules.git",
"modules"], cwd=dot_viper)
p.wait()
dot_viper_modules = os.path.join(dot_viper, "modules")

if os.path.exists(dot_viper_modules):
# Pull updates
p = subprocess.Popen(["git", "pull"], cwd=dot_viper_modules)
p.wait()
else:
# Clone the repository.
p = subprocess.Popen(["git", "clone", "git@github.com:viper-framework/viper-modules.git",
"modules"], cwd=dot_viper)
p.wait()

# Initialize submodules.
p = subprocess.Popen(["git", "submodule", "init"], cwd=dot_viper_modules)
p.wait()
Expand Down

0 comments on commit 0f727f6

Please sign in to comment.