Skip to content

Commit 93556d3

Browse files
committed
Stop searching config if we reach root directory
1 parent 6440f1a commit 93556d3

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

CSScomb.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ def comb(self, css, syntax, config_path):
4343
stdout=PIPE, stdin=PIPE, stderr=PIPE,
4444
env=self.get_env(), shell=self.is_windows())
4545
except OSError:
46-
raise Exception('Couldn\'t find Node.js. Make sure it\'s in your $PATH by running `node -v` in your command-line.')
46+
raise Exception("Couldn't find Node.js. Make sure it's in your " +
47+
'$PATH by running `node -v` in your command-line.')
4748
stdout, stderr = p.communicate(input=css.encode('utf-8'))
4849
if stdout:
4950
return stdout.decode('utf-8')
@@ -57,7 +58,9 @@ def get_config_path(self, config_path=''):
5758
if os.path.exists(config_path):
5859
return config_path
5960

60-
if os.path.dirname(config_path) == os.path.expanduser('~'):
61+
parent_dir = os.path.dirname(config_path)
62+
if os.path.dirname(config_path) in (os.path.expanduser('~'),
63+
os.path.dirname(parent_dir)):
6164
return ''
6265

6366
config_path = os.path.dirname(os.path.dirname(config_path)) + '/.csscomb.json'

0 commit comments

Comments
 (0)