Skip to content

Commit e5658bc

Browse files
committed
Remove compile_commands.json before writing it
This fix existing as a symlink to a cmake directory seems like a pretty common use case, and the error when it fails to write is pretty inscrutable. Fixes hedronvision#105
1 parent a14ad3a commit e5658bc

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

refresh.template.py

+5
Original file line numberDiff line numberDiff line change
@@ -1414,6 +1414,11 @@ def main():
14141414
There should be actionable warnings, above, that led to this.""")
14151415
sys.exit(1)
14161416

1417+
try:
1418+
os.remove('compile_commands.json')
1419+
except FileNotFoundError:
1420+
pass
1421+
14171422
# Chain output into compile_commands.json
14181423
with open('compile_commands.json', 'w') as output_file:
14191424
json.dump(

0 commit comments

Comments
 (0)