comparison piecrust/processing/sass.py @ 499:a406b75c4bea

sass: Overwrite the old map file with the new one always.
author Ludovic Chabant <ludovic@chabant.com>
date Thu, 23 Jul 2015 23:03:33 -0700
parents aa686b8fbfd0
children 81d9c3a3a0b5
comparison
equal deleted inserted replaced
498:35d4c172e5a6 499:a406b75c4bea
99 # seem to be any option to override that, sadly... so we need to move 99 # seem to be any option to override that, sadly... so we need to move
100 # it to the cache directory. 100 # it to the cache directory.
101 if self.app.cache.enabled: 101 if self.app.cache.enabled:
102 src_map_file = out_path + '.map' 102 src_map_file = out_path + '.map'
103 dst_map_file = self._getMapPath(in_path) 103 dst_map_file = self._getMapPath(in_path)
104 try: 104 if os.path.exists(dst_map_file):
105 os.rename(src_map_file, dst_map_file) 105 os.remove(dst_map_file)
106 except OSError: 106 os.rename(src_map_file, dst_map_file)
107 pass
108 107
109 if retcode != 0: 108 if retcode != 0:
110 raise Exception("Error occured in Sass compiler. Please check " 109 raise Exception("Error occured in Sass compiler. Please check "
111 "log messages above for more information.") 110 "log messages above for more information.")
112 111