HBGDki / ghap

Tools for working on ghap
Other
3 stars 3 forks source link

git archive not working on windows #5

Open yonicd opened 7 years ago

yonicd commented 7 years ago

i wrote show_repo.R that returns the structure of the head of a repo prior to merging the remote with the local master. This works in tandem with a sparse checkout, when you are blind to the repo directory tree structure.

It works on all platforms but windows. I am getting this error (below) back. The same script works in cmd and gitbash. What would be the correct call from R?

> system(' git archive --format=tar HEAD | tar t')
fatal: pathspec '|' did not match any files
Warning message:
running command ' git archive --format=tar HEAD | tar t' had status 128 
yonicd commented 7 years ago

@hafen

yonicd commented 7 years ago

obviously this was the problem....

 if(.Platform$OS.type=='windows'){
    shell('git archive --format=tar HEAD | tar t > _archive_.txt')
  }else{
    system('git archive --format=tar HEAD | tar t > _archive_.txt') 
  }