balena-cli
Version:
The official balena Command Line Interface
56 lines (54 loc) • 2.01 kB
JavaScript
var _a;
Object.defineProperty(exports, "__esModule", { value: true });
const core_1 = require("@oclif/core");
const ec = require("../../utils/env-common");
const lazy_1 = require("../../utils/lazy");
const validation_1 = require("../../utils/validation");
class EnvRenameCmd extends core_1.Command {
async run() {
const { args: params, flags: opt } = await this.parse(_a);
const { checkLoggedIn } = await Promise.resolve().then(() => require('../../utils/patterns'));
await checkLoggedIn();
await (0, lazy_1.getBalenaSdk)().pine.patch({
resource: ec.getVarResourceName(opt.config, opt.device, opt.service),
id: params.id,
body: {
value: params.value,
},
});
}
}
_a = EnvRenameCmd;
EnvRenameCmd.description = (0, lazy_1.stripIndent) `
Change the value of a config or env var for a fleet, device or service.
Change the value of a configuration or environment variable for a fleet,
device or service, as selected by command-line options.
${ec.rmRenameHelp.split('\n').join('\n\t\t')}
`;
EnvRenameCmd.examples = [
'$ balena env rename 123123 emacs',
'$ balena env rename 234234 emacs --service',
'$ balena env rename 345345 emacs --device',
'$ balena env rename 456456 emacs --device --service',
'$ balena env rename 567567 1 --config',
'$ balena env rename 678678 1 --device --config',
];
EnvRenameCmd.args = {
id: core_1.Args.integer({
required: true,
description: "variable's numeric database ID",
parse: async (input) => (0, validation_1.parseAsInteger)(input, 'id'),
}),
value: core_1.Args.string({
required: true,
description: "variable value; if omitted, use value from this process' environment",
}),
};
EnvRenameCmd.flags = {
config: ec.booleanConfig,
device: ec.booleanDevice,
service: ec.booleanService,
};
exports.default = EnvRenameCmd;
//# sourceMappingURL=rename.js.map
;