Skip to content

Commit

Permalink
fix(dev): Permit refresh_source to be run from within a non-spinnaker…
Browse files Browse the repository at this point in the history
… repo. (#1574)
  • Loading branch information
Eric Wiseblatt committed Apr 17, 2017
1 parent 4de91fe commit ccd8ef4
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions dev/refresh_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -555,12 +555,20 @@ def main(cls):

refresher = cls(options)
in_repository_url = refresher.get_remote_repository_url('.')
if in_repository_url:
expected_dir = os.path.dirname(
os.path.dirname(os.path.dirname(os.path.abspath(__file__))))

if (in_repository_url
and os.path.basename(in_repository_url).startswith('spinnaker')):
sys.stderr.write(
'ERROR: You cannot run this script from within a local repository.\n'
' This directory is from "{url}".\n'
' Did you intend to be in the parent directory?\n'
.format(url=in_repository_url))
'ERROR: Assuming you did not intend to run this from inside'
' your spinnaker repo.\n'
' This directory is from the repository:\n'
' {url}.\n'
' The normal use case would be to run this from:\n'
' {expected_dir}\n'
' to manage this repo alongside the others.\n'
.format(url=in_repository_url, expected_dir=expected_dir))
return -1

try:
Expand Down

0 comments on commit ccd8ef4

Please sign in to comment.