mirror of
https://github.com/balena-io/balena-cli.git
synced 2024-12-30 10:38:50 +00:00
Tweaks to config options handling after review
This commit is contained in:
parent
36eb0a108e
commit
70be2ae596
@ -15,7 +15,6 @@ limitations under the License.
|
|||||||
*/
|
*/
|
||||||
import Promise = require('bluebird');
|
import Promise = require('bluebird');
|
||||||
import ResinSdk = require('resin-sdk');
|
import ResinSdk = require('resin-sdk');
|
||||||
import _ = require('lodash');
|
|
||||||
import deviceConfig = require('resin-device-config');
|
import deviceConfig = require('resin-device-config');
|
||||||
import * as semver from 'resin-semver';
|
import * as semver from 'resin-semver';
|
||||||
|
|
||||||
@ -25,13 +24,12 @@ export function generateBaseConfig(
|
|||||||
application: ResinSdk.Application,
|
application: ResinSdk.Application,
|
||||||
options: { version?: string; appUpdatePollInterval?: number },
|
options: { version?: string; appUpdatePollInterval?: number },
|
||||||
) {
|
) {
|
||||||
options = _.mapValues(options, function(value, key) {
|
if (options.appUpdatePollInterval) {
|
||||||
if (key === 'appUpdatePollInterval') {
|
options = {
|
||||||
return options[key]! * 60 * 1000;
|
...options,
|
||||||
} else {
|
appUpdatePollInterval: options.appUpdatePollInterval * 60 * 1000,
|
||||||
return value;
|
};
|
||||||
}
|
}
|
||||||
});
|
|
||||||
|
|
||||||
return Promise.props({
|
return Promise.props({
|
||||||
userId: resin.auth.getUserId(),
|
userId: resin.auth.getUserId(),
|
||||||
|
Loading…
Reference in New Issue
Block a user