Skip to content

Instantly share code, notes, and snippets.

@drhr
Created April 22, 2017 04:06
Show Gist options
  • Save drhr/2cfae5e2b922e58111ad9c39c8608eeb to your computer and use it in GitHub Desktop.
Save drhr/2cfae5e2b922e58111ad9c39c8608eeb to your computer and use it in GitHub Desktop.
set IntelliJ CLion "Single instance only" mode on all named build targets
import sys, xml.etree.ElementTree as ET
with open('.idea/workspace.xml', 'r') as f:
data = f.read()
tree = ET.fromstring(data)
configurations = tree.findall('.//configuration[@default="false"][@TARGET_NAME]')
for c in configurations:
c.attrib['singleton'] = "true"
with open('.idea/workspace.xml', 'w') as f:
f.write(ET.tostring(tree))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment