自分で使ってないからオプションには対応していない。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// usage: cscript.exe //Nologo clist-lo-pkg-cfg.js > package.config | |
(function () { | |
var wsh = WScript.CreateObject("WScript.Shell"); | |
var wshExec = wsh.Exec("chocolatey.exe list --local-only"); | |
while (wshExec.Status == 0) | |
WScript.Sleep(100); | |
var listText = wshExec.StdOut.ReadAll(); | |
var listLines = listText.split("\r\n").slice(1, -2); | |
var packagesConfig = ""; | |
packagesConfig += "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<packages>\n"; | |
for (var n = 0; n < listLines.length; n++) { | |
var line = listLines[n]; | |
var values = line.split(" "); | |
packagesConfig += " <package id=\"" + values[0] + "\" version=\"" + values[1] + "\" />\n"; | |
} | |
packagesConfig += "</packages>"; | |
WScript.Echo(packagesConfig); | |
})(); | |
WScript.Quit(); |
0 件のコメント:
コメントを投稿