История изменений
Исправление crutch_master, (текущая версия) :
альтернативу
На, держи
#!/usr/bin/node
var http = require("some_http_lib");
var argparser = require("some_argparesr_lib");
var payload = {"assetTypes":["Microsoft.VisualStudio.Services.Icons.Default","Microsoft.VisualStudio.Services.Icons.Branding","Microsoft.VisualStudio.Services.Icons.Small"],"filters":[{"criteria":[{"filterType":8,"value":"Microsoft.VisualStudio.Code"},{"filterType":10,"value":"target:\"Microsoft.VisualStudio.Code\" "},{"filterType":12,"value":"37888"}],"direction":2,"pageSize":54,"pageNumber":1,"sortBy":4,"sortOrder":0,"pagingToken":null}],"flags":870};
var url = "https://marketplace.visualstudio.com/_apis/public/gallery/extensionquery";
var headers = {'Accept': 'application/json;api-version=5.1-preview.1;excludeUrls=true'}
var pages = argparser.get("-n","number") || 1;
for (var i = 0; i < pages; i++) {
payload.pages = i;
var res = await http.post({
url : url,
payload : payload,
headers : headers});
let extensions = [];
res.results[0].extensions.forEach((ext) => {
let name = [ext.publisher.publisherName, ext.extensionName].join(".");
extensions.push(name);
});
var cmd = 'code ' + extensions.map((v)=>{return "--install-extension "+v})
.join(' ');
console.log(cmd);
}
Исходная версия crutch_master, :
альтернативу
На, держи
#!/usr/bin/node
var http = require("some_http_lib");
var argparser = require("some_argparesr_lib");
var payload = {"assetTypes":["Microsoft.VisualStudio.Services.Icons.Default","Microsoft.VisualStudio.Services.Icons.Branding","Microsoft.VisualStudio.Services.Icons.Small"],"filters":[{"criteria":[{"filterType":8,"value":"Microsoft.VisualStudio.Code"},{"filterType":10,"value":"target:\"Microsoft.VisualStudio.Code\" "},{"filterType":12,"value":"37888"}],"direction":2,"pageSize":54,"pageNumber":1,"sortBy":4,"sortOrder":0,"pagingToken":null}],"flags":870};
var url = "https://marketplace.visualstudio.com/_apis/public/gallery/extensionquery";
var headers = {'Accept': 'application/json;api-version=5.1-preview.1;excludeUrls=true'}
var pages = argparser.get("-n","number") || 1;
for (var i = 0; i < pages; i++) {
payload.pages = i;
var res = await http.post({
url : url,
payload : payload,
headers : headers});
let extensions = []
res.results[0].extensions.forEach((ext) => {
let name = [ext.publisher.publisherName, ext.extensionName].join(".");
extensions.push(name);
});
var cmd = 'code ' + extensions.map((v)=>{return "--install-extension "+v})
.join(' ');
console.log(cmd);
}