Skip to content

Commit

Permalink
Avoid 'fatal: not a git repository (or any of the parent directories)…
Browse files Browse the repository at this point in the history
…: .git' error from python script since appveyor doesn't have a .git folder.
  • Loading branch information
bchavez committed Oct 15, 2018
1 parent c7ebfff commit e336606
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 3 additions & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,6 @@ artifacts:
name: Zip
- path: packaging\windows\*.exe
name: Setup


on_failure:
# - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
6 changes: 4 additions & 2 deletions defines.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def local_path(self):
def repository_root(self):
if self._repository_root is None:
try:
if self.no_git:
if ('APPVEYOR' in os.environ) or self.no_git:
self._repository_root = self.local_path
else:
self._repository_root = os.path.abspath(check_output(['git', 'rev-parse', '--show-toplevel']).rstrip())
Expand All @@ -49,7 +49,9 @@ def repository_root(self):
def repository_version(self):
if self._repository_version is None:
try:
if self.no_git:
if 'APPVEYOR_REPO_COMMIT' in os.environ:
self._repository_version = os.environ['APPVEYOR_REPO_COMMIT'].rstrip()
elif self.no_git:
if 'FREELAN_NO_GIT_VERSION' not in os.environ:
raise RuntimeError(errstr='You must specify FREELAN_NO_GIT_VERSION when FREELAN_NO_GIT is specified.')

Expand Down

0 comments on commit e336606

Please sign in to comment.