#288: migrating tool from 0.6.0 to 0.6.1 breaks users.

This commit is contained in:
Andre Rodrigues 2012-08-02 10:08:04 +01:00
Родитель f915264771
Коммит 14167f905c
1 изменённых файлов: 27 добавлений и 2 удалений

Просмотреть файл

@ -427,7 +427,32 @@ exports.init = function (cli) {
account.managementEndpointUrl = function () {
var cfg = account.readConfig();
// check if it is the configuration format used
// by version <= 0.6.0 and if so fix-up
if (cfg.port) {
cfg.endpoint = url.format({
protocol: 'http',
hostname: cfg.endpoint,
port: cfg.port
});
delete cfg.port;
// Save fixed-up configuration
account.writeConfig(cfg);
}
// Check if there is a value for Subscription (caps) and
// if so fix-up to all lower case
if (cfg.Subscription) {
cfg.subscription = cfg.Subscription;
delete cfg.Subscription;
// Save fixed-up configuration
account.writeConfig(cfg);
}
return cfg.endpoint;
};
};
};