Skip to content

Commit

Permalink
bug fix on updating existing sparseimaging repo
Browse files Browse the repository at this point in the history
  • Loading branch information
tnakazato committed Sep 8, 2022
1 parent ee64226 commit 250c070
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,11 +244,15 @@ def initialize_options(self):
raise PriismDependencyError('No download command found: you have to install git or curl or wget')

if is_git_ok:
self.unpack_cmds = []
self.unpack_cwd = '.'
self.epilogue_cmds = ['git checkout {}'.format(commit)]
self.epilogue_cwd = package
else:
self.epilogue_cmds = ['unzip {}'.format(zipname),
self.unpack_cmds = ['unzip {}'.format(zipname),
'ln -s {0}-{1} {0}'.format(package, commit)]
self.unpack_cwd = '.'
self.epilogue_cmds = []
self.epilogue_cwd = '.'
self.package_directory = package

Expand All @@ -260,8 +264,11 @@ def run(self):

if not os.path.exists(self.package_directory):
execute_command(self.download_cmd)
for cmd in self.epilogue_cmds:
execute_command(cmd, cwd=self.epilogue_cwd)
for cmd in self.unpack_cmds:
execute_command(cmd, cwd=self.unpack_cwd)

for cmd in self.epilogue_cmds:
execute_command(cmd, cwd=self.epilogue_cwd)


class download_sakura(config):
Expand Down

0 comments on commit 250c070

Please sign in to comment.