mirror of
https://github.com/balena-io/balena-cli.git
synced 2025-02-21 09:51:58 +00:00
Convert command settings
to oclif
Change-type: patch Signed-off-by: Scott Lowe <scott@balena.io>
This commit is contained in:
parent
a6ccd87069
commit
49b00e18ae
@ -104,7 +104,7 @@ const capitanoDoc = {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'Settings',
|
title: 'Settings',
|
||||||
files: ['build/actions/settings.js'],
|
files: ['build/actions-oclif/settings.js'],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'Local',
|
title: 'Local',
|
||||||
|
@ -229,10 +229,6 @@ If you come across any problems or would like to get in touch:
|
|||||||
|
|
||||||
- [push <applicationOrDevice>](#push-applicationordevice)
|
- [push <applicationOrDevice>](#push-applicationordevice)
|
||||||
|
|
||||||
- Settings
|
|
||||||
|
|
||||||
- [settings](#settings)
|
|
||||||
|
|
||||||
- Local
|
- Local
|
||||||
|
|
||||||
- [local configure <target>](#local-configure-target)
|
- [local configure <target>](#local-configure-target)
|
||||||
@ -1813,16 +1809,6 @@ left hand side of the = character will be treated as the variable name.
|
|||||||
On Windows only, convert line endings from CRLF (Windows format) to LF (Unix format).
|
On Windows only, convert line endings from CRLF (Windows format) to LF (Unix format).
|
||||||
Source files are not modified.
|
Source files are not modified.
|
||||||
|
|
||||||
# Settings
|
|
||||||
|
|
||||||
## settings
|
|
||||||
|
|
||||||
Use this command to display detected settings
|
|
||||||
|
|
||||||
Examples:
|
|
||||||
|
|
||||||
$ balena settings
|
|
||||||
|
|
||||||
# Local
|
# Local
|
||||||
|
|
||||||
## local configure <target>
|
## local configure <target>
|
||||||
|
52
lib/actions-oclif/settings.ts
Normal file
52
lib/actions-oclif/settings.ts
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
/**
|
||||||
|
* @license
|
||||||
|
* Copyright 2020 Balena Ltd.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { flags } from '@oclif/command';
|
||||||
|
import { stripIndent } from 'common-tags';
|
||||||
|
import Command from '../command';
|
||||||
|
import * as cf from '../utils/common-flags';
|
||||||
|
import { getBalenaSdk } from '../utils/lazy';
|
||||||
|
|
||||||
|
interface FlagsDef {
|
||||||
|
help: void;
|
||||||
|
}
|
||||||
|
|
||||||
|
export default class SettingsCmd extends Command {
|
||||||
|
public static description = stripIndent`
|
||||||
|
Print current settings.
|
||||||
|
|
||||||
|
Use this command to display current balena CLI settings.
|
||||||
|
`;
|
||||||
|
public static examples = ['$ balena settings'];
|
||||||
|
|
||||||
|
public static usage = 'settings';
|
||||||
|
|
||||||
|
public static flags: flags.Input<FlagsDef> = {
|
||||||
|
help: cf.help,
|
||||||
|
};
|
||||||
|
|
||||||
|
public async run() {
|
||||||
|
this.parse<FlagsDef, {}>(SettingsCmd);
|
||||||
|
|
||||||
|
const prettyjson = await import('prettyjson');
|
||||||
|
|
||||||
|
return getBalenaSdk()
|
||||||
|
.settings.getAll()
|
||||||
|
.then(prettyjson.render)
|
||||||
|
.then(console.log);
|
||||||
|
}
|
||||||
|
}
|
@ -27,7 +27,6 @@ module.exports =
|
|||||||
notes: require('./notes')
|
notes: require('./notes')
|
||||||
help: require('./help')
|
help: require('./help')
|
||||||
os: require('./os')
|
os: require('./os')
|
||||||
settings: require('./settings')
|
|
||||||
config: require('./config')
|
config: require('./config')
|
||||||
ssh: require('./ssh')
|
ssh: require('./ssh')
|
||||||
internal: require('./internal')
|
internal: require('./internal')
|
||||||
|
@ -1,38 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright 2016-2017 Balena
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
you may not use this file except in compliance with the License.
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software
|
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
See the License for the specific language governing permissions and
|
|
||||||
limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import { CommandDefinition } from 'capitano';
|
|
||||||
import { getBalenaSdk } from '../utils/lazy';
|
|
||||||
|
|
||||||
export const list: CommandDefinition = {
|
|
||||||
signature: 'settings',
|
|
||||||
description: 'print current settings',
|
|
||||||
help: `\
|
|
||||||
Use this command to display detected settings
|
|
||||||
|
|
||||||
Examples:
|
|
||||||
|
|
||||||
$ balena settings\
|
|
||||||
`,
|
|
||||||
async action() {
|
|
||||||
const prettyjson = await import('prettyjson');
|
|
||||||
|
|
||||||
return getBalenaSdk()
|
|
||||||
.settings.getAll()
|
|
||||||
.then(prettyjson.render)
|
|
||||||
.then(console.log);
|
|
||||||
},
|
|
||||||
};
|
|
@ -101,9 +101,6 @@ capitano.command(actions.config.inject)
|
|||||||
capitano.command(actions.config.reconfigure)
|
capitano.command(actions.config.reconfigure)
|
||||||
capitano.command(actions.config.generate)
|
capitano.command(actions.config.generate)
|
||||||
|
|
||||||
# ---------- Settings Module ----------
|
|
||||||
capitano.command(actions.settings.list)
|
|
||||||
|
|
||||||
# ---------- Logs Module ----------
|
# ---------- Logs Module ----------
|
||||||
capitano.command(actions.logs.logs)
|
capitano.command(actions.logs.logs)
|
||||||
|
|
||||||
|
@ -133,6 +133,7 @@ export const convertedCommands = [
|
|||||||
'env:rm',
|
'env:rm',
|
||||||
'os:configure',
|
'os:configure',
|
||||||
'version',
|
'version',
|
||||||
|
'settings',
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user