All files / src/commands/make-default make-default.command.js

82.35% Statements 14/17
100% Branches 1/1
0% Functions 0/1
82.35% Lines 14/17

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18193x 193x 193x 193x 193x 193x 193x 193x 193x 193x 193x 193x       193x 193x  
import { defineCommand } from '../../lib/define-command.js';
import { styleText } from '../../lib/style-text.js';
import { Logger } from '../../logger.js';
import * as AppConfig from '../../models/app_configuration.js';
import { aliasArg } from '../global.args.js';
 
export const makeDefaultCommand = defineCommand({
  description: 'Make a linked application the default one',
  since: '0.5.0',
  options: {},
  args: [aliasArg],
  async handler(_options, alias) {
    await AppConfig.setDefault(alias);

    Logger.printSuccess(`The application ${styleText('green', alias)} has been set as default`);
  },
});