diff --git a/coreos_prometheus/Tiltfile b/coreos_prometheus/Tiltfile index b46c5c586..1ba6bf46e 100644 --- a/coreos_prometheus/Tiltfile +++ b/coreos_prometheus/Tiltfile @@ -3,13 +3,15 @@ def _find_root_tiltfile_dir(): # Find top-level Tilt path current = os.path.abspath('./') - while current != '/': - if os.path.exists(os.path.join(current, 'Tiltfile')): + while True: + if os.path.exists(os.path.join(current, 'tilt_modules')): return current - current = os.path.dirname(current) + next_dir = os.path.dirname(current) + if next_dir == current: + fail('Could not find root Tiltfile') - fail('Could not find root Tiltfile') + current = next_dir def _find_cache_dir(): cachedir = os.getenv('TILT_CACHE_DIR', '') diff --git a/git_resource/Tiltfile b/git_resource/Tiltfile index 8224878a7..10b7443f8 100644 --- a/git_resource/Tiltfile +++ b/git_resource/Tiltfile @@ -2,13 +2,15 @@ def _find_root_tiltfile_dir(): # Find top-level Tilt path current = os.path.abspath('./') - while current != '/': + while True: if os.path.exists(os.path.join(current, 'tilt_modules')): return current - current = os.path.dirname(current) + next_dir = os.path.dirname(current) + if next_dir == current: + fail('Could not find root Tiltfile') - fail('Could not find root Tiltfile') + current = next_dir def _find_checkout_dir(): from_env = os.getenv('TILT_GIT_RESOURCE_CHECKOUT_DIR', '') diff --git a/helm_remote/Tiltfile b/helm_remote/Tiltfile index 38ad57ec2..9857383e9 100644 --- a/helm_remote/Tiltfile +++ b/helm_remote/Tiltfile @@ -19,13 +19,15 @@ if _get_skip() == None: def _find_root_tiltfile_dir(): # Find top-level Tilt path current = os.path.abspath('./') - while current != '/': + while True: if os.path.exists(os.path.join(current, 'tilt_modules')): return current - current = os.path.dirname(current) + next_dir = os.path.dirname(current) + if next_dir == current: + fail('Could not find root Tiltfile') - fail('Could not find root Tiltfile') + current = next_dir def _find_cache_dir(): from_env = os.getenv('TILT_HELM_REMOTE_CACHE_DIR', '')