Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@TakamiChie
Created June 13, 2021 14:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TakamiChie/c42c452ba8b1328d2dab65dda7111bcd to your computer and use it in GitHub Desktop.
Save TakamiChie/c42c452ba8b1328d2dab65dda7111bcd to your computer and use it in GitHub Desktop.
choco list --localonlyから一括処理用のXMLファイルを作る
import sys
print("""<?xml version="1.0" encoding="utf-8"?>
<packages>""")
for line in sys.stdin:
l = line.strip().split(" ")
if l[1] != "packages":
print(f' <package id="{l[0]}" version="{l[1]}" />')
print("</packages>")
@TakamiChie
Copy link
Author

ファイルをパスの通ったフォルダに置き、choco list --localonly | chocolateyxml.py > PC.configのような感じで呼び出すと良い。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment