Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixing issue with js2xml

  • Loading branch information...
commit b462816b1385ab514146fff11b2983daf7140dc5 1 parent 9458d7f
@andrerod andrerod authored
View
100 lib/cli/commands/site.js
@@ -26,6 +26,7 @@ var child_process = require("child_process");
var utils = require("../utils");
var constants = require("../constants");
var cacheUtils = require("../cacheUtils");
+var js2xml = require("../../util/js2xml");
var linkedRevisionControl = require("../linkedrevisioncontrol");
@@ -70,7 +71,7 @@ exports.init = function(cli) {
var site = cli.category("site").description("Commands to manage your web sites");
- site.command("list").whiteListPowershell().description("List your web sites").option("-s, --subscription <id>", "use the subscription id").execute(function __1(options, _) { var parameters, sites, s; var __frame = { name: "__1", line: 77 }; return __func(_, this, arguments, __1, 1, __frame, function __$__1() {
+ site.command("list").whiteListPowershell().description("List your web sites").option("-s, --subscription <id>", "use the subscription id").execute(function __1(options, _) { var parameters, sites, s; var __frame = { name: "__1", line: 78 }; return __func(_, this, arguments, __1, 1, __frame, function __$__1() {
@@ -175,7 +176,7 @@ exports.init = function(cli) {
- function promptForSiteName(_) { var __frame = { name: "promptForSiteName", line: 178 }; return __func(_, this, arguments, promptForSiteName, 0, __frame, function __$promptForSiteName() {
+ function promptForSiteName(_) { var __frame = { name: "promptForSiteName", line: 179 }; return __func(_, this, arguments, promptForSiteName, 0, __frame, function __$promptForSiteName() {
log.silly("promptForSiteName"); return (function __$promptForSiteName(__then) {
if ((context.site.name === undefined)) {
log.help("Need a site name");
@@ -183,7 +184,7 @@ exports.init = function(cli) {
- function determineIfSiteExists(_) { var sites, hits, displayNameMatches; var __frame = { name: "determineIfSiteExists", line: 186 }; return __func(_, this, arguments, determineIfSiteExists, 0, __frame, function __$determineIfSiteExists() {
+ function determineIfSiteExists(_) { var sites, hits, displayNameMatches; var __frame = { name: "determineIfSiteExists", line: 187 }; return __func(_, this, arguments, determineIfSiteExists, 0, __frame, function __$determineIfSiteExists() {
log.silly("determineIfSiteExists");
return site.doSitesGet(context, __cb(_, __frame, 2, 24, function ___(__0, __1) { sites = __1;
hits = sites.filter(function(item) {
@@ -209,7 +210,7 @@ exports.init = function(cli) {
- function promptForLocation(_) { var displayNameMatches; var __frame = { name: "promptForLocation", line: 212 }; return __func(_, this, arguments, promptForLocation, 0, __frame, function __$promptForLocation() {
+ function promptForLocation(_) { var displayNameMatches; var __frame = { name: "promptForLocation", line: 213 }; return __func(_, this, arguments, promptForLocation, 0, __frame, function __$promptForLocation() {
log.silly("promptForLocation");
return ensureSpaces(context, __cb(_, __frame, 2, 12, function __$promptForLocation() {
@@ -243,7 +244,7 @@ exports.init = function(cli) {
- function copyIisNodeWhenServerJsPresent(_) { var sourcePath; var __frame = { name: "copyIisNodeWhenServerJsPresent", line: 246 }; return __func(_, this, arguments, copyIisNodeWhenServerJsPresent, 0, __frame, function __$copyIisNodeWhenServerJsPresent() {
+ function copyIisNodeWhenServerJsPresent(_) { var sourcePath; var __frame = { name: "copyIisNodeWhenServerJsPresent", line: 247 }; return __func(_, this, arguments, copyIisNodeWhenServerJsPresent, 0, __frame, function __$copyIisNodeWhenServerJsPresent() {
log.silly("copyWebConfigWhenServerJsPresent"); return (function __$copyIisNodeWhenServerJsPresent(__then) {
if ((!utils.pathExistsSync("iisnode.yml") && ((utils.pathExistsSync("server.js") || utils.pathExistsSync("app.js"))))) {
log.info("Creating default iisnode.yml file");
@@ -252,7 +253,7 @@ exports.init = function(cli) {
- function updateLocalConfigWithSiteName(_) { var cfg; var __frame = { name: "updateLocalConfigWithSiteName", line: 255 }; return __func(_, this, arguments, updateLocalConfigWithSiteName, 0, __frame, function __$updateLocalConfigWithSiteName() {
+ function updateLocalConfigWithSiteName(_) { var cfg; var __frame = { name: "updateLocalConfigWithSiteName", line: 256 }; return __func(_, this, arguments, updateLocalConfigWithSiteName, 0, __frame, function __$updateLocalConfigWithSiteName() {
log.silly("updateLocalConfigWithSiteName"); return (function __$updateLocalConfigWithSiteName(__then) {
if (context.flags.isGitWorkingTree) {
return site.readConfig(__cb(_, __frame, 3, 24, function ___(__0, __1) { cfg = __1;
@@ -262,14 +263,14 @@ exports.init = function(cli) {
- function createSite(_) { var __frame = { name: "createSite", line: 265 }; return __func(_, this, arguments, createSite, 0, __frame, function __$createSite() {
+ function createSite(_) { var __frame = { name: "createSite", line: 266 }; return __func(_, this, arguments, createSite, 0, __frame, function __$createSite() {
log.silly("createSite"); return (function __$createSite(__then) {
if (!context.flags.siteExists) {
return site.doSitesPost(context, __cb(_, __frame, 3, 14, __then, true)); } else { __then(); } ; })(_); }); };
- function initializeRemoteRepo(_) { var __frame = { name: "initializeRemoteRepo", line: 272 }; return __func(_, this, arguments, initializeRemoteRepo, 0, __frame, function __$initializeRemoteRepo() {
+ function initializeRemoteRepo(_) { var __frame = { name: "initializeRemoteRepo", line: 273 }; return __func(_, this, arguments, initializeRemoteRepo, 0, __frame, function __$initializeRemoteRepo() {
log.silly("InitializeRemoteRepo"); return (function __$initializeRemoteRepo(__then) {
if (!context.flags.siteExists) {
return site.doRepositoryPost(context, __cb(_, __frame, 3, 14, function __$initializeRemoteRepo() {
@@ -285,7 +286,7 @@ exports.init = function(cli) {
log.silly("context.repo", context.repo); _(); }); }); };
- function addRemoteToLocalGitRepo(_) { var remotes, azureExists, gitUri; var __frame = { name: "addRemoteToLocalGitRepo", line: 288 }; return __func(_, this, arguments, addRemoteToLocalGitRepo, 0, __frame, function __$addRemoteToLocalGitRepo() {
+ function addRemoteToLocalGitRepo(_) { var remotes, azureExists, gitUri; var __frame = { name: "addRemoteToLocalGitRepo", line: 289 }; return __func(_, this, arguments, addRemoteToLocalGitRepo, 0, __frame, function __$addRemoteToLocalGitRepo() {
log.silly("addRemoteToLocalGitRepo");
if (!context.flags.isGitWorkingTree) {
log.info((("To create a local git repository to publish to the remote site, please rerun this command with the --git flag: \"azure site create " + ((((context.site && context.site.name)) || "{site name}"))) + " --git\".")); return _(null); } ; return (function __$addRemoteToLocalGitRepo(__then) {
@@ -313,17 +314,17 @@ exports.init = function(cli) {
return exec(("git remote add azure " + gitUri), __cb(_, __frame, 25, 12, _, true)); }); }, true)); }); }); };
- function ensureSpaces(context, _) { var __frame = { name: "ensureSpaces", line: 316 }; return __func(_, this, arguments, ensureSpaces, 1, __frame, function __$ensureSpaces() { return (function __$ensureSpaces(__then) {
+ function ensureSpaces(context, _) { var __frame = { name: "ensureSpaces", line: 317 }; return __func(_, this, arguments, ensureSpaces, 1, __frame, function __$ensureSpaces() { return (function __$ensureSpaces(__then) {
if (!context.spaces) {
return cacheUtils.readSpaces(context, __cb(_, __frame, 2, 31, function ___(__0, __1) { context.spaces = __1; return (function __$ensureSpaces(__then) {
if ((!context.spaces || !context.spaces.length)) {
- return context.site.doSpacesGet(context, __cb(_, __frame, 4, 33, function ___(__0, __2) { context.spaces = __2; __then(); }, true)); } else { __then(); } ; })(__then); }, true)); } else { __then(); } ; })(_); }); }; var __frame = { name: "__2", line: 127 }; return __func(_, this, arguments, __2, 2, __frame, function __$__2() { context = { subscription: cli.category("account").lookupSubscriptionId(options.subscription), git: options.git, site: { name: nameArg, webspace: options.location, hostname: options.hostname }, publishingUser: options.publishingUsername, username: options.username, password: options.pass, remoteUri: options.repository, flags: { } }; if ((options.git && options.github)) { return _(new Error("Please run the command with either --git or --github options. Not both.")); } ; return promptForSiteName(__cb(_, __frame, 21, 10, function __$__2() { return determineIfSiteExists(__cb(_, __frame, 22, 10, function __$__2() { return promptForLocation(__cb(_, __frame, 23, 10, function __$__2() { return createSite(__cb(_, __frame, 24, 10, function __$__2() { return (function __$__2(__then) { if ((options.git || options.github)) { if (options.github) { context.lvcClient = linkedRevisionControl.createClient(cli, "github"); } else { if (options.git) { context.lvcClient = linkedRevisionControl.createClient(cli, "git"); } ; } ; return context.lvcClient.init(context, __cb(_, __frame, 34, 12, function __$__2() { return copyIisNodeWhenServerJsPresent(__cb(_, __frame, 37, 12, function __$__2() { return updateLocalConfigWithSiteName(__cb(_, __frame, 38, 12, function __$__2() { return initializeRemoteRepo(__cb(_, __frame, 40, 12, function __$__2() { return (function __$__2(__then) { if (options.git) { return addRemoteToLocalGitRepo(__cb(_, __frame, 43, 14, __then, true)); } else { return (function __$__2(__then) { if (options.github) { return site.ensureRepositoryUri(context, __cb(_, __frame, 45, 14, __then, true)); } else { __then(); } ; })(__then); } ; })(function __$__2() { return context.lvcClient.deploy(context, __cb(_, __frame, 48, 12, __then, true)); }); }, true)); }, true)); }, true)); }, true)); } else { __then(); } ; })(_); }, true)); }, true)); }, true)); }, true)); }); });
+ return context.site.doSpacesGet(context, __cb(_, __frame, 4, 33, function ___(__0, __2) { context.spaces = __2; __then(); }, true)); } else { __then(); } ; })(__then); }, true)); } else { __then(); } ; })(_); }); }; var __frame = { name: "__2", line: 128 }; return __func(_, this, arguments, __2, 2, __frame, function __$__2() { context = { subscription: cli.category("account").lookupSubscriptionId(options.subscription), git: options.git, site: { name: nameArg, webspace: options.location, hostname: options.hostname }, publishingUser: options.publishingUsername, username: options.username, password: options.pass, remoteUri: options.repository, flags: { } }; if ((options.git && options.github)) { return _(new Error("Please run the command with either --git or --github options. Not both.")); } ; return promptForSiteName(__cb(_, __frame, 21, 10, function __$__2() { return determineIfSiteExists(__cb(_, __frame, 22, 10, function __$__2() { return promptForLocation(__cb(_, __frame, 23, 10, function __$__2() { return createSite(__cb(_, __frame, 24, 10, function __$__2() { return (function __$__2(__then) { if ((options.git || options.github)) { if (options.github) { context.lvcClient = linkedRevisionControl.createClient(cli, "github"); } else { if (options.git) { context.lvcClient = linkedRevisionControl.createClient(cli, "git"); } ; } ; return context.lvcClient.init(context, __cb(_, __frame, 34, 12, function __$__2() { return copyIisNodeWhenServerJsPresent(__cb(_, __frame, 37, 12, function __$__2() { return updateLocalConfigWithSiteName(__cb(_, __frame, 38, 12, function __$__2() { return initializeRemoteRepo(__cb(_, __frame, 40, 12, function __$__2() { return (function __$__2(__then) { if (options.git) { return addRemoteToLocalGitRepo(__cb(_, __frame, 43, 14, __then, true)); } else { return (function __$__2(__then) { if (options.github) { return site.ensureRepositoryUri(context, __cb(_, __frame, 45, 14, __then, true)); } else { __then(); } ; })(__then); } ; })(function __$__2() { return context.lvcClient.deploy(context, __cb(_, __frame, 48, 12, __then, true)); }); }, true)); }, true)); }, true)); }, true)); } else { __then(); } ; })(_); }, true)); }, true)); }, true)); }, true)); }); });
- function portalCreateSiteInstruction(context, _) { var href; var __frame = { name: "portalCreateSiteInstruction", line: 326 }; return __func(_, this, arguments, portalCreateSiteInstruction, 1, __frame, function __$portalCreateSiteInstruction() {
+ function portalCreateSiteInstruction(context, _) { var href; var __frame = { name: "portalCreateSiteInstruction", line: 327 }; return __func(_, this, arguments, portalCreateSiteInstruction, 1, __frame, function __$portalCreateSiteInstruction() {
log.help("You must create your first web site using the Windows Azure portal.");
log.help("Please follow these steps in the portal:");
log.help("1. At the bottom of the page, click on New > Web Site > Quick Create");
@@ -342,7 +343,7 @@ exports.init = function(cli) {
- function getPublishingUser(context, _) { var publishingUsers, filters; var __frame = { name: "getPublishingUser", line: 345 }; return __func(_, this, arguments, getPublishingUser, 1, __frame, function __$getPublishingUser() {
+ function getPublishingUser(context, _) { var publishingUsers, filters; var __frame = { name: "getPublishingUser", line: 346 }; return __func(_, this, arguments, getPublishingUser, 1, __frame, function __$getPublishingUser() {
publishingUsers = toArray(context.publishingUsers);
filters = publishingUsers.filter(function(item) {
return ((typeof item === "string") && (item.length <= 64)); }); return (function __$getPublishingUser(__then) {
@@ -360,7 +361,7 @@ exports.init = function(cli) {
return prompt("Publishing username: ", __cb(_, __frame, 15, 11, _, true)); }); }); };
- function portalGitInitInstruction(context, _) { var href; var __frame = { name: "portalGitInitInstruction", line: 363 }; return __func(_, this, arguments, portalGitInitInstruction, 1, __frame, function __$portalGitInitInstruction() {
+ function portalGitInitInstruction(context, _) { var href; var __frame = { name: "portalGitInitInstruction", line: 364 }; return __func(_, this, arguments, portalGitInitInstruction, 1, __frame, function __$portalGitInitInstruction() {
log.help("You must create your git publishing credentials using the Windows Azure portal.");
log.help("Please follow these steps in the portal:");
log.help("1. In the menu on the left select \"Web Sites\"");
@@ -380,7 +381,7 @@ exports.init = function(cli) {
var location = site.category("location").description("Commands to manage your Azure locations");
- location.command("list").whiteListPowershell().description("List locations available for your account").execute(function __3(options, _) { var context, spaces, s; var __frame = { name: "__3", line: 386 }; return __func(_, this, arguments, __3, 1, __frame, function __$__3() {
+ location.command("list").whiteListPowershell().description("List locations available for your account").execute(function __3(options, _) { var context, spaces, s; var __frame = { name: "__3", line: 387 }; return __func(_, this, arguments, __3, 1, __frame, function __$__3() {
@@ -402,7 +403,7 @@ exports.init = function(cli) {
- site.command("portal [name]").whiteListPowershell().description("Opens the portal in a browser to manage your web sites").option("-r, --realm <realm>", "specifies organization used for login").execute(function __4(name, options, _) { var href; var __frame = { name: "__4", line: 409 }; return __func(_, this, arguments, __4, 2, __frame, function __$__4() {
+ site.command("portal [name]").whiteListPowershell().description("Opens the portal in a browser to manage your web sites").option("-r, --realm <realm>", "specifies organization used for login").execute(function __4(name, options, _) { var href; var __frame = { name: "__4", line: 410 }; return __func(_, this, arguments, __4, 2, __frame, function __$__4() {
@@ -422,7 +423,7 @@ exports.init = function(cli) {
common.launchBrowser(targetUrl); _(); }); });
- site.command("browse [name]").whiteListPowershell().description("Open your web site in a browser.").option("-s, --subscription <id>", "use the subscription id").execute(function __5(name, options, _) { var context, cache, siteData, href; var __frame = { name: "__5", line: 429 }; return __func(_, this, arguments, __5, 2, __frame, function __$__5() {
+ site.command("browse [name]").whiteListPowershell().description("Open your web site in a browser.").option("-s, --subscription <id>", "use the subscription id").execute(function __5(name, options, _) { var context, cache, siteData, href; var __frame = { name: "__5", line: 430 }; return __func(_, this, arguments, __5, 2, __frame, function __$__5() {
@@ -436,14 +437,14 @@ exports.init = function(cli) {
return lookupSiteNameAndWebSpace(context, __cb(_, __frame, 9, 22, function ___(__0, __2) { cache = __2; return (function __$__5(_) {
- var __1 = cache; if (__1) { return _(null, __1); } ; return site.doSiteGet(context, __cb(_, __frame, 10, 40, _, true)); })(__cb(_, __frame, -428, 17, function ___(__0, __3) { siteData = clean(__3);
+ var __1 = cache; if (__1) { return _(null, __1); } ; return site.doSiteGet(context, __cb(_, __frame, 10, 40, _, true)); })(__cb(_, __frame, -429, 17, function ___(__0, __3) { siteData = clean(__3);
href = ("http://" + toArray(siteData.HostNames)[0]);
common.launchBrowser(href); _(); }, true)); }, true)); }); });
- site.command("show [name]").whiteListPowershell().description("Show details for a web site").option("-s, --subscription <id>", "use the subscription id").execute(function __6(name, options, _) { var context, result, repositoryUri, gitUri, settings, data, index; var __frame = { name: "__6", line: 450 }; return __func(_, this, arguments, __6, 2, __frame, function __$__6() {
+ site.command("show [name]").whiteListPowershell().description("Show details for a web site").option("-s, --subscription <id>", "use the subscription id").execute(function __6(name, options, _) { var context, result, repositoryUri, gitUri, settings, data, index; var __frame = { name: "__6", line: 451 }; return __func(_, this, arguments, __6, 2, __frame, function __$__6() {
@@ -460,9 +461,9 @@ exports.init = function(cli) {
log.info("Showing details for site");
log.verbose("Parameters", context);
- return async.parallel([function __1(_) { var __frame = { name: "__1", line: 464 }; return __func(_, this, arguments, __1, 0, __frame, function __$__1() {
+ return async.parallel([function __1(_) { var __frame = { name: "__1", line: 465 }; return __func(_, this, arguments, __1, 0, __frame, function __$__1() {
return site.doSiteGet(context, __cb(_, __frame, 0, 34, _, true)); });
- },function __2(_) { var __frame = { name: "__2", line: 465 }; return __func(_, this, arguments, __2, 0, __frame, function __$__2() { return site.doSiteConfigGet(context, __cb(_, __frame, 0, 34, _, true)); }); },], __cb(_, __frame, 13, 23, function ___(__0, __3) { result = __3;
+ },function __2(_) { var __frame = { name: "__2", line: 466 }; return __func(_, this, arguments, __2, 0, __frame, function __$__2() { return site.doSiteConfigGet(context, __cb(_, __frame, 0, 34, _, true)); }); },], __cb(_, __frame, 13, 23, function ___(__0, __3) { result = __3;
@@ -494,7 +495,7 @@ exports.init = function(cli) {
- function lookupSiteName(context, _) { var cfg; var __frame = { name: "lookupSiteName", line: 497 }; return __func(_, this, arguments, lookupSiteName, 1, __frame, function __$lookupSiteName() {
+ function lookupSiteName(context, _) { var cfg; var __frame = { name: "lookupSiteName", line: 498 }; return __func(_, this, arguments, lookupSiteName, 1, __frame, function __$lookupSiteName() {
if ((context.site.name !== undefined)) { return _(null); } ;
@@ -515,7 +516,7 @@ exports.init = function(cli) {
- function lookupSiteWebSpace(context, _) { var sites, index; var __frame = { name: "lookupSiteWebSpace", line: 518 }; return __func(_, this, arguments, lookupSiteWebSpace, 1, __frame, function __$lookupSiteWebSpace() {
+ function lookupSiteWebSpace(context, _) { var sites, index; var __frame = { name: "lookupSiteWebSpace", line: 519 }; return __func(_, this, arguments, lookupSiteWebSpace, 1, __frame, function __$lookupSiteWebSpace() {
log.verbose("Attempting to locate site ", context.site.name);
return site.doSitesGet(context, __cb(_, __frame, 2, 16, function ___(__0, __1) { sites = __1;
for (index in sites) {
@@ -529,7 +530,7 @@ exports.init = function(cli) {
- function lookupSiteNameAndWebSpace(context, _) { var cache; var __frame = { name: "lookupSiteNameAndWebSpace", line: 532 }; return __func(_, this, arguments, lookupSiteNameAndWebSpace, 1, __frame, function __$lookupSiteNameAndWebSpace() {
+ function lookupSiteNameAndWebSpace(context, _) { var cache; var __frame = { name: "lookupSiteNameAndWebSpace", line: 533 }; return __func(_, this, arguments, lookupSiteNameAndWebSpace, 1, __frame, function __$lookupSiteNameAndWebSpace() {
return lookupSiteName(context, __cb(_, __frame, 1, 4, function __$lookupSiteNameAndWebSpace() {
return cacheUtils.readSite(context, __cb(_, __frame, 2, 16, function ___(__0, __1) { cache = __1;
if ((cache || context.site.webspace)) {
@@ -603,7 +604,7 @@ exports.init = function(cli) {
site.getRepositoryAuth = getRepositoryAuth;
- function ensureRepositoryUri(context, _) { var siteData, repositoryUri; var __frame = { name: "ensureRepositoryUri", line: 606 }; return __func(_, this, arguments, ensureRepositoryUri, 1, __frame, function __$ensureRepositoryUri() {
+ function ensureRepositoryUri(context, _) { var siteData, repositoryUri; var __frame = { name: "ensureRepositoryUri", line: 607 }; return __func(_, this, arguments, ensureRepositoryUri, 1, __frame, function __$ensureRepositoryUri() {
return site.lookupSiteNameAndWebSpace(context, __cb(_, __frame, 1, 19, function ___(__0, __1) { siteData = __1;
repositoryUri = (siteData && site.getRepositoryUri(siteData)); return (function __$ensureRepositoryUri(__then) {
if (!repositoryUri) {
@@ -617,7 +618,7 @@ exports.init = function(cli) {
site.ensureRepositoryUri = ensureRepositoryUri;
- site.command("delete [name]").whiteListPowershell().description("Delete a web site").option("-s, --subscription <id>", "use the subscription id").option("-q, --quiet", "quiet mode, do not ask for delete confirmation").execute(function __7(name, options, _) { var context, progress, result; var __frame = { name: "__7", line: 625 }; return __func(_, this, arguments, __7, 2, __frame, function __$__7() {
+ site.command("delete [name]").whiteListPowershell().description("Delete a web site").option("-s, --subscription <id>", "use the subscription id").option("-q, --quiet", "quiet mode, do not ask for delete confirmation").execute(function __7(name, options, _) { var context, progress, result; var __frame = { name: "__7", line: 626 }; return __func(_, this, arguments, __7, 2, __frame, function __$__7() {
@@ -633,7 +634,7 @@ exports.init = function(cli) {
return lookupSiteNameAndWebSpace(context, __cb(_, __frame, 8, 10, function __$__7() {
log.info("Deleting site", context.site.name); return (function __$__7(_) {
- var __1 = !options.quiet; if (!__1) { return _(null, __1); } ; return confirm((("Delete " + context.site.name) + " site? (y/n) "), __cb(_, __frame, 11, 33, function ___(__0, __3) { var __2 = !__3; return _(null, __2); }, true)); })(__cb(_, __frame, -624, 17, function ___(__0, __2) { return (function __$__7(__then) { if (__2) { return _(null); } else { __then(); } ; })(function __$__7() {
+ var __1 = !options.quiet; if (!__1) { return _(null, __1); } ; return confirm((("Delete " + context.site.name) + " site? (y/n) "), __cb(_, __frame, 11, 33, function ___(__0, __3) { var __2 = !__3; return _(null, __2); }, true)); })(__cb(_, __frame, -625, 17, function ___(__0, __2) { return (function __$__7(__then) { if (__2) { return _(null); } else { __then(); } ; })(function __$__7() {
@@ -656,7 +657,7 @@ exports.init = function(cli) {
- site.command("start [name]").whiteListPowershell().description("Start a web site").option("-s, --subscription <id>", "use the subscription id").execute(function __8(name, options, _) { var context, progress, result; var __frame = { name: "__8", line: 663 }; return __func(_, this, arguments, __8, 2, __frame, function __$__8() {
+ site.command("start [name]").whiteListPowershell().description("Start a web site").option("-s, --subscription <id>", "use the subscription id").execute(function __8(name, options, _) { var context, progress, result; var __frame = { name: "__8", line: 664 }; return __func(_, this, arguments, __8, 2, __frame, function __$__8() {
@@ -707,7 +708,7 @@ exports.init = function(cli) {
log.info((("Site " + context.site.name) + " has been started")); _(); }); }); }, true)); }); });
- site.command("stop [name]").whiteListPowershell().description("Stop a web site").option("-s, --subscription <id>", "use the subscription id").execute(function __9(name, options, _) { var context, progress, result; var __frame = { name: "__9", line: 714 }; return __func(_, this, arguments, __9, 2, __frame, function __$__9() {
+ site.command("stop [name]").whiteListPowershell().description("Stop a web site").option("-s, --subscription <id>", "use the subscription id").execute(function __9(name, options, _) { var context, progress, result; var __frame = { name: "__9", line: 715 }; return __func(_, this, arguments, __9, 2, __frame, function __$__9() {
@@ -762,19 +763,19 @@ exports.init = function(cli) {
- site.readConfig = function site_readConfig__10(_) { var __frame = { name: "site_readConfig__10", line: 765 }; return __func(_, this, arguments, site_readConfig__10, 0, __frame, function __$site_readConfig__10() {
+ site.readConfig = function site_readConfig__10(_) { var __frame = { name: "site_readConfig__10", line: 766 }; return __func(_, this, arguments, site_readConfig__10, 0, __frame, function __$site_readConfig__10() {
return site.readConfigValue("azure.site.name", __cb(_, __frame, 2, 12, function ___(__0, __2) {
return site.readConfigValue("azure.site.webspace", __cb(_, __frame, 3, 16, function ___(__0, __3) { var __1 = { name: __2, webspace: __3 }; return _(null, __1); }, true)); }, true)); }); };
- site.writeConfig = function site_writeConfig__11(cfg, _) { var __frame = { name: "site_writeConfig__11", line: 772 }; return __func(_, this, arguments, site_writeConfig__11, 1, __frame, function __$site_writeConfig__11() {
+ site.writeConfig = function site_writeConfig__11(cfg, _) { var __frame = { name: "site_writeConfig__11", line: 773 }; return __func(_, this, arguments, site_writeConfig__11, 1, __frame, function __$site_writeConfig__11() {
return site.writeConfigValue("azure.site.name", cfg.name, __cb(_, __frame, 1, 4, function __$site_writeConfig__11() {
return site.writeConfigValue("azure.site.webspace", cfg.webspace, __cb(_, __frame, 2, 4, _, true)); }, true)); }); };
- site.readConfigValue = function site_readConfigValue__12(name, _) { var result; var __frame = { name: "site_readConfigValue__12", line: 777 }; return __func(_, this, arguments, site_readConfigValue__12, 1, __frame, function __$site_readConfigValue__12() { return (function ___(__then) { (function ___(_) { __tryCatch(_, function __$site_readConfigValue__12() {
+ site.readConfigValue = function site_readConfigValue__12(name, _) { var result; var __frame = { name: "site_readConfigValue__12", line: 778 }; return __func(_, this, arguments, site_readConfigValue__12, 1, __frame, function __$site_readConfigValue__12() { return (function ___(__then) { (function ___(_) { __tryCatch(_, function __$site_readConfigValue__12() {
return exec(("git config --get " + name), __cb(_, __frame, 2, 19, function ___(__0, __1) { result = __1;
return _(null, ((result.stdout + result.stderr)).trim()); }, true)); }); })(function ___(err, __result) { __tryCatch(_, function __$site_readConfigValue__12() { if (err) {
@@ -785,7 +786,7 @@ exports.init = function(cli) {
- site.writeConfigValue = function site_writeConfigValue__13(name, value, _) { var __frame = { name: "site_writeConfigValue__13", line: 788 }; return __func(_, this, arguments, site_writeConfigValue__13, 2, __frame, function __$site_writeConfigValue__13() {
+ site.writeConfigValue = function site_writeConfigValue__13(name, value, _) { var __frame = { name: "site_writeConfigValue__13", line: 789 }; return __func(_, this, arguments, site_writeConfigValue__13, 2, __frame, function __$site_writeConfigValue__13() {
return exec(((("git config " + name) + " ") + value), __cb(_, __frame, 1, 4, _, true)); }); };
@@ -883,7 +884,7 @@ exports.init = function(cli) {
- site.doSpacesGet = function site_doSpacesGet__14(options, _) { var progress, result, spaces; var __frame = { name: "site_doSpacesGet__14", line: 886 }; return __func(_, this, arguments, site_doSpacesGet__14, 1, __frame, function __$site_doSpacesGet__14() {
+ site.doSpacesGet = function site_doSpacesGet__14(options, _) { var progress, result, spaces; var __frame = { name: "site_doSpacesGet__14", line: 887 }; return __func(_, this, arguments, site_doSpacesGet__14, 1, __frame, function __$site_doSpacesGet__14() {
log.verbose("Subscription", options.subscription);
progress = cli.progress("Enumerating locations"); return (function ___(__then) { (function ___(_) { __tryCatch(_, function __$site_doSpacesGet__14() {
@@ -905,7 +906,7 @@ exports.init = function(cli) {
- site.doSitesGet = function site_doSitesGet__15(options, _) { var spaces, channel, progress, result, sites; var __frame = { name: "site_doSitesGet__15", line: 908 }; return __func(_, this, arguments, site_doSitesGet__15, 1, __frame, function __$site_doSitesGet__15() {
+ site.doSitesGet = function site_doSitesGet__15(options, _) { var spaces, channel, progress, result, sites; var __frame = { name: "site_doSitesGet__15", line: 909 }; return __func(_, this, arguments, site_doSitesGet__15, 1, __frame, function __$site_doSitesGet__15() {
log.verbose("Subscription", options.subscription);
return site.doSpacesGet(options, __cb(_, __frame, 3, 17, function ___(__0, __2) { spaces = __2;
@@ -917,7 +918,7 @@ exports.init = function(cli) {
progress = cli.progress("Enumerating sites"); return (function ___(__then) { (function ___(_) { __tryCatch(_, function __$site_doSitesGet__15() {
- return async.map(spaces, function __1(webspace, _) { var __frame = { name: "__1", line: 922 }; return __func(_, this, arguments, __1, 1, __frame, function __$__1() {
+ return async.map(spaces, function __1(webspace, _) { var __frame = { name: "__1", line: 923 }; return __func(_, this, arguments, __1, 1, __frame, function __$__1() {
@@ -996,13 +997,30 @@ exports.init = function(cli) {
- site.doRepositoryGet = function site_doRepositoryGet__16(options, _) { var siteData; var __frame = { name: "site_doRepositoryGet__16", line: 999 }; return __func(_, this, arguments, site_doRepositoryGet__16, 1, __frame, function __$site_doRepositoryGet__16() {
+ site.doSiteConfigPUT = function site_doSiteConfigPUT__16(config, options, _) { var progress, xmlConfig; var __frame = { name: "site_doSiteConfigPUT__16", line: 1000 }; return __func(_, this, arguments, site_doSiteConfigPUT__16, 2, __frame, function __$site_doSiteConfigPUT__16() {
+ progress = cli.progress("Retrieving site config information");
+ xmlConfig = js2xml.serialize(config);
+
+
+
+
+
+
+
+
+ return getChannel().path(options.subscription).path("services").path("webspaces").path(options.site.webspace).path("sites").path(options.site.name).path("config").PUT(function(req) {
+ req.write(xmlConfig);
+ req.end(); }, __cb(_, __frame, 11, 4, _, true)); }); };
+
+
+
+ site.doRepositoryGet = function site_doRepositoryGet__17(options, _) { var siteData; var __frame = { name: "site_doRepositoryGet__17", line: 1017 }; return __func(_, this, arguments, site_doRepositoryGet__17, 1, __frame, function __$site_doRepositoryGet__17() {
return site.doSiteGet(options, __cb(_, __frame, 1, 19, function ___(__0, __1) { siteData = __1;
return _(null, getRepositoryUri(siteData)); }, true)); }); };
- site.doPublishingUsersGet = function site_doPublishingUsersGet__17(options, _) { var progress, publishingUsers; var __frame = { name: "site_doPublishingUsersGet__17", line: 1004 }; return __func(_, this, arguments, site_doPublishingUsersGet__17, 1, __frame, function __$site_doPublishingUsersGet__17() {
- progress = cli.progress("Retrieving user information"); return (function ___(__then) { (function ___(_) { __tryCatch(_, function __$site_doPublishingUsersGet__17() { return (function ___(__then) { (function ___(_) { __tryCatch(_, function __$site_doPublishingUsersGet__17() {
+ site.doPublishingUsersGet = function site_doPublishingUsersGet__18(options, _) { var progress, publishingUsers; var __frame = { name: "site_doPublishingUsersGet__18", line: 1022 }; return __func(_, this, arguments, site_doPublishingUsersGet__18, 1, __frame, function __$site_doPublishingUsersGet__18() {
+ progress = cli.progress("Retrieving user information"); return (function ___(__then) { (function ___(_) { __tryCatch(_, function __$site_doPublishingUsersGet__18() { return (function ___(__then) { (function ___(_) { __tryCatch(_, function __$site_doPublishingUsersGet__18() {
@@ -1014,10 +1032,10 @@ exports.init = function(cli) {
return getChannel().path(options.subscription).path("services").path("webspaces").path("").query("properties", "publishingUsers").GET(__cb(_, __frame, 10, 36, function ___(__0, __1) { publishingUsers = clean(__1);
log.verbose("PublishingUsers", publishingUsers);
- return _(null, publishingUsers); }, true)); }); })(function ___(e, __result) { __tryCatch(_, function __$site_doPublishingUsersGet__17() { if (e) {
+ return _(null, publishingUsers); }, true)); }); })(function ___(e, __result) { __tryCatch(_, function __$site_doPublishingUsersGet__18() { if (e) {
- return _(null, ["","",]); } else { _(null, __result); } ; }); }); })(function ___() { __tryCatch(_, function __$site_doPublishingUsersGet__17() { _(null, null, true); }); }); }); })(function ___(__e, __r, __cont) { (function ___(__then) { __tryCatch(_, function __$site_doPublishingUsersGet__17() {
+ return _(null, ["","",]); } else { _(null, __result); } ; }); }); })(function ___() { __tryCatch(_, function __$site_doPublishingUsersGet__18() { _(null, null, true); }); }); }); })(function ___(__e, __r, __cont) { (function ___(__then) { __tryCatch(_, function __$site_doPublishingUsersGet__18() {
View
18 lib/cli/commands/site_.js
@@ -26,6 +26,7 @@ var child_process = require('child_process');
var utils = require('../utils');
var constants = require('../constants');
var cacheUtils = require('../cacheUtils');
+var js2xml = require('../../util/js2xml');
var linkedRevisionControl = require('../linkedrevisioncontrol');
@@ -996,6 +997,23 @@ exports.init = function (cli) {
});
};
+ site.doSiteConfigPUT = function (config, options, _) {
+ var progress = cli.progress('Retrieving site config information');
+ var xmlConfig = js2xml.serialize(config);
+ getChannel()
+ .path(options.subscription)
+ .path('services')
+ .path('webspaces')
+ .path(options.site.webspace)
+ .path('sites')
+ .path(options.site.name)
+ .path('config')
+ .PUT(function (req) {
+ req.write(xmlConfig);
+ req.end();
+ }, _);
+ };
+
site.doRepositoryGet = function (options, _) {
var siteData = site.doSiteGet(options, _);
return getRepositoryUri(siteData);
View
43 lib/cli/commands/siteconfig.js
@@ -68,8 +68,7 @@ exports.init = function(cli) {
return channel; };
- siteConfig.command("list [name]").whiteListPowershell().usage("[options] <commitId> [name]").description("Show your git deployment").option("-s, --subscription <id>", "use the subscription id").execute(function __1(name, options, _) { var context, siteConfigurations; var __frame = { name: "__1", line: 76 }; return __func(_, this, arguments, __1, 2, __frame, function __$__1() {
-
+ siteConfig.command("list [name]").usage("[options] [name]").description("Show your site application settings").option("-s, --subscription <id>", "use the subscription id").execute(function __1(name, options, _) { var context, siteConfigurations; var __frame = { name: "__1", line: 75 }; return __func(_, this, arguments, __1, 2, __frame, function __$__1() {
@@ -89,4 +88,42 @@ exports.init = function(cli) {
row.cell("Name", item.GeoRegion); }); }
else {
- log.info("No app settings defined yet. You can define app settings using \"azure site config sites created yet. You can create new sites using \"azure site create\" or through the portal."); } ; _(); }, true)); }, true)); }); });};
+ log.info("No app settings defined yet. You can define app settings using \"azure site config set <name>=<value>."); } ; _(); }, true)); }, true)); }); });
+
+
+
+ siteConfig.command("set <key> [name]").usage("[options] <key> [name]").description("Sets an application setting for your site").option("-s, --subscription <id>", "use the subscription id").execute(function __2(keyvaluepair, name, options, _) { var context, siteConfigurations, siteConfig; var __frame = { name: "__2", line: 99 }; return __func(_, this, arguments, __2, 3, __frame, function __$__2() {
+
+
+
+
+ context = {
+ subscription: cli.category("account").lookupSubscriptionId(options.subscription),
+ site: {
+ name: name },
+
+ keyvaluepair: options.keyvaluepair };
+
+
+ return site.lookupSiteNameAndWebSpace(context, __cb(_, __frame, 9, 6, function __$__2() {
+ return site.doSiteConfigGet(context, __cb(_, __frame, 10, 31, function ___(__0, __1) { siteConfigurations = __1;
+ siteConfig = {
+ SiteConfig: siteConfigurations };
+
+ return site.doSiteConfigPUT(siteConfig, context, __cb(_, __frame, 14, 6, _, true)); }, true)); }, true)); }); });
+
+
+ siteConfig.command("unset <key> [name]").usage("[options] <keyvaluepair> [name]").description("Unsets an application setting for your site").option("-s, --subscription <id>", "use the subscription id").execute(function __3(keyvaluepair, name, options, _) { var context; var __frame = { name: "__3", line: 120 }; return __func(_, this, arguments, __3, 3, __frame, function __$__3() {
+
+
+
+
+ context = {
+ subscription: cli.category("account").lookupSubscriptionId(options.subscription),
+ site: {
+ name: name },
+
+ keyvaluepair: options.keyvaluepair };
+
+
+ return site.lookupSiteNameAndWebSpace(context, __cb(_, __frame, 9, 6, _, true)); }); });};
View
7 lib/cli/commands/siteconfig_.js
@@ -106,8 +106,11 @@ exports.init = function (cli) {
};
site.lookupSiteNameAndWebSpace(context, _);
-
-
+ var siteConfigurations = site.doSiteConfigGet(context, _);
+ var siteConfig = {
+ SiteConfig: siteConfigurations
+ };
+ site.doSiteConfigPUT(siteConfig, context, _);
});
siteConfig.command('unset <key> [name]')
View
22 lib/util/js2xml.js
@@ -34,12 +34,16 @@ exports.serialize = function (entity) {
if (entity[rootElementName][Constants.XML_METADATA_MARKER]) {
for (var metadata in entity[rootElementName][Constants.XML_METADATA_MARKER]) {
- doc.att(metadata, entity[rootElementName][Constants.XML_METADATA_MARKER][metadata]);
+ if (entity[rootElementName][Constants.XML_METADATA_MARKER].hasOwnProperty(metadata)) {
+ doc.att(metadata, entity[rootElementName][Constants.XML_METADATA_MARKER][metadata]);
+ }
}
}
for (var attribute in entity[rootElementName]) {
- doc = _writeAtomEntryValue(doc, attribute, entity[rootElementName][attribute]);
+ if (attribute !== Constants.XML_METADATA_MARKER && entity[rootElementName].hasOwnProperty(attribute)) {
+ doc = _writeElementValue(doc, attribute, entity[rootElementName][attribute]);
+ }
}
doc = doc.doc();
@@ -55,7 +59,7 @@ exports.serialize = function (entity) {
* @param {object} value Property value.
* @return {object} The current DOM element.
*/
-function _writeAtomEntryValue (parentElement, name, value) {
+function _writeElementValue (parentElement, name, value) {
var ignored = false;
var propertyTagName = name;
@@ -65,7 +69,9 @@ function _writeAtomEntryValue (parentElement, name, value) {
if (Array.isArray(value) && value.length > 0) {
for (var i in value) {
- parentElement = _writeAtomEntryValue(parentElement, name, value[i]);
+ if (value.hasOwnProperty(i)) {
+ parentElement = _writeElementValue(parentElement, name, value[i]);
+ }
}
// For an array no element was actually added at this level, so skip uping level.
@@ -73,8 +79,8 @@ function _writeAtomEntryValue (parentElement, name, value) {
} else if (typeof value === 'object') {
parentElement = parentElement.ele(propertyTagName);
for (var propertyName in value) {
- if (propertyName !== Constants.XML_METADATA_MARKER) {
- parentElement = _writeAtomEntryValue(parentElement, propertyName, value[propertyName]);
+ if (propertyName !== Constants.XML_METADATA_MARKER && value.hasOwnProperty(propertyName)) {
+ parentElement = _writeElementValue(parentElement, propertyName, value[propertyName]);
}
}
} else {
@@ -92,7 +98,9 @@ function _writeAtomEntryValue (parentElement, name, value) {
// include the metadata
var attributeList = value[Constants.XML_METADATA_MARKER];
for (var attribute in attributeList) {
- parentElement = parentElement.att(attribute, attributeList[attribute]);
+ if (attributeList.hasOwnProperty(attribute)) {
+ parentElement = parentElement.att(attribute, attributeList[attribute]);
+ }
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.