diff --git a/lesscompiler.py b/lesscompiler.py index 5cc1846..079cbaf 100644 --- a/lesscompiler.py +++ b/lesscompiler.py @@ -134,10 +134,13 @@ def convert_one(self, is_auto_save=False): # if you've set the main_file (relative to current file), only that file # gets compiled this allows you to have one file with lots of @imports if self.settings['main_file']: - self.file_name = os.path.join( - os.path.dirname(self.file_name), - self.settings['main_file'] - ) + if not os.path.isabs(self.settings['main_file']): + self.file_name = os.path.abspath( + os.path.join( + dirs['project'], + self.settings['main_file'] + ) + ) # compile the LESS file return self.convertLess2Css(