updateDocumentSnippets.py 816 B

1234567891011121314151617181920212223
  1. #!/usr/bin/env python3
  2. from scriptCommon import catchPath
  3. import os
  4. import subprocess
  5. # ---------------------------------------------------
  6. # Update code examples
  7. # ---------------------------------------------------
  8. # For info on mdsnippets, see https://github.com/SimonCropp/MarkdownSnippets
  9. # install dotnet SDK from http://go.microsoft.com/fwlink/?LinkID=798306&clcid=0x409
  10. # Then install MarkdownSnippets.Tool with
  11. # dotnet tool install -g MarkdownSnippets.Tool
  12. # To update:
  13. # dotnet tool update -g MarkdownSnippets.Tool
  14. # To uninstall (e.g. to downgrade to a lower version)
  15. # dotnet tool uninstall -g MarkdownSnippets.Tool
  16. os.chdir(catchPath)
  17. subprocess.run('dotnet tool update -g MarkdownSnippets.Tool --version 21.2.0', shell=True, check=True)
  18. subprocess.run('mdsnippets', shell=True, check=True)