Skip to content

Commit

Permalink
Drop 'h1 config cli'
Browse files Browse the repository at this point in the history
  • Loading branch information
ad-m committed Dec 13, 2018
1 parent f6db830 commit 83dcd7a
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 38 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Expand Up @@ -12,7 +12,6 @@ jobs:
- npm ci
- npm link
- npm run lint
- h1 config cli
- npm run docs
- git status
- git diff HEAD
Expand Down
17 changes: 0 additions & 17 deletions bin/config/cli/index.js

This file was deleted.

4 changes: 0 additions & 4 deletions bin/config/index.js
Expand Up @@ -12,8 +12,4 @@ category.addChild(require('./set'));
category.addChild(require('./get'));
category.addChild(require('./unset'));

if (process.env.NODE_ENV !== 'production') {
category.addChild(require('./cli'));
}

module.exports = category;
15 changes: 3 additions & 12 deletions bin/index.js
Expand Up @@ -34,21 +34,12 @@ if (config.get('profile.apiKey') || process.env.NODE_ENV !== 'production') {
cli.addChild(require('./organisation'));
}

cli.addChild(require('./log'));

const cli_resources = [
'vm', 'disk', 'image', 'iso', 'network', 'ip',
'dns', 'netgw', 'firewall', 'vault', 'snapshot',
'replica',
'vm', 'disk', 'replica', 'iso', 'network', 'ip', 'dns', 'netgw', 'firewall',
'vault', 'snapshot', 'image', 'reservation', 'log',
];

const cli_config = config.get('cli', {});

if ('resources' in cli_config) {
cli_resources
.filter(resource => cli_config.resources.includes(resource))
.forEach(resource => cli.addChild(require(`./${resource}`)));
}
cli_resources.forEach(resource => cli.addChild(require(`./${resource}`)));

// inject defaultValues from config defaults
const applyDefault = (element, defaults) => {
Expand Down
2 changes: 0 additions & 2 deletions bin/login/index.js
Expand Up @@ -5,7 +5,6 @@ const Cli = require('lib/cli');
const logger = require('lib/logger');
const _ = require('lodash');
const interactive = require('lib/interactive');
const config = require('lib/config');

const options = {
username: {
Expand Down Expand Up @@ -42,7 +41,6 @@ const handler = async args => {

return p
.then(async () => {
config.set('cli', await args.helpers.api.get('/cli'));
return logger('info', 'You successfully logged and stored your session identifier in config file');
}).catch(e => {
if (e.status === 404 || e.status === 401) {
Expand Down
5 changes: 3 additions & 2 deletions docs/index.md
Expand Up @@ -7,11 +7,10 @@
* [h1 reservation](reservation.md) - Manage your reservation
* [h1 service](service.md) - Explore available services
* [h1 organisation](organisation.md) - Manage your organisation
* [h1 log](log.md) - Manage your log archive
* [h1 vm](vm.md) - Manage your virtual machine
* [h1 disk](disk.md) - Manage your disk
* [h1 replica](replica.md) - Manage your replica
* [h1 iso](iso.md) - Manage your ISO
* [h1 log](log.md) - Manage your log archive
* [h1 network](network.md) - Manage your network
* [h1 ip](ip.md) - Manage your IP address
* [h1 dns](dns.md) - Manage your DNS - zones and records
Expand All @@ -20,3 +19,5 @@
* [h1 vault](vault.md) - Manage your Vault
* [h1 snapshot](snapshot.md) - Manage your snapshot
* [h1 image](image.md) - Manage your image
* [h1 reservation](reservation.md) - Manage your reservation
* [h1 iso](iso.md) - Manage your ISO

0 comments on commit 83dcd7a

Please sign in to comment.