- chrome_pws = os.path.join(home, '.config', 'google-chrome', 'Custom Dictionary.txt')
- with open(chrome_pws, 'w', encoding='utf-8') as fp:
- fp.write('\n'.join(words) + '\n')
+ chrome_pws = home / ".config" / "google-chrome" / "Custom Dictionary.txt"
+ chrome_pws.write_text(content, encoding="utf-8")
+
+ if opts.commit:
+ subprocess.run(
+ ["git", "commit", "-m", "dict: add more words", pws, chrome_pws], cwd=home
+ )