Skip to content

Commit

Permalink
Tentative windows compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
sbidoul committed Apr 25, 2018
1 parent 4f7e989 commit 86c4cbe
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions setuptools_odoo/git_file_finder.py
Expand Up @@ -20,17 +20,17 @@ def _git_toplevel(path):
def _git_ls_files_and_dirs(toplevel):
# use git archive instead of git ls-file to honor
# export-ignore git attribute
prefix = os.path.join(toplevel, '')
cmd = ['git', 'archive', '--prefix', prefix, 'HEAD']
cmd = ['git', 'archive', '--prefix', toplevel + os.path.sep, 'HEAD']
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, cwd=toplevel)
tf = tarfile.open(fileobj=proc.stdout, mode='r|*')
git_files = set()
git_dirs = set([toplevel])
for member in tf.getmembers():
name = member.name.replace('/', os.path.sep)
if member.type == tarfile.DIRTYPE:
git_dirs.add(member.name)
git_dirs.add(name)
else:
git_files.add(member.name)
git_files.add(name)
return git_files, git_dirs


Expand Down

0 comments on commit 86c4cbe

Please sign in to comment.