2.0.2 • Published 8 months ago

@battis/qui-cli.shell v2.0.2

Weekly downloads
-
License
GPL-3.0
Repository
github
Last release
8 months ago

@battis/qui-cli.shell

@battis/qui-cli Plugin: Standardized shelljs wrapper

npm version Module type: ESM

Install

npm install @battis/qui-cli.shell @battis/qui-cli.core

Usage

import { Shell } from '@battis/qui-cli.shell';
import { Core } from '@battis/qui-cli.core';

// configure Shell
Root.configure({ showCommands: true });

// use Shell
Shell.exec('echo "hello world"');

Configuration

export type Configuration = Plugin.Configuration & {
  showCommands?: boolean;
  silent?: boolean;
};

showCommands

Whether or not to display the commands (rather than just their output) in the console, defaults to false.

silent

Whether or not to show command output (and, potentially, commands themselves) in the console, defaults to true.

Options

Shell exposes both showCommands and silent as user-configurable command line arguments.

Initialization

After user-provided command line arguments are parsed, Shell is updated to reflect user-specified configuration.

API

import { Shell } from '@battis/qui-cli.shell';

Shell.get()

Returns the actual shelljs object.

Shell.exec(command, { silent }): shelljs.ShellString

Execute an arbitrary command in the shell, optionally overriding the current silent setting.

Shell.getPreviousResult(): shelljs.ShellString

Get the result of the most-recently executed command.

Shell.isSilent(): boolean

Whether or not the shell is currently set to silent.

Shell.commandsShown(): boolean

Whether or not the shell is currently set to showCommands.

2.0.2

8 months ago

2.0.1

9 months ago

2.0.0

9 months ago

1.0.0

9 months ago

0.8.3

11 months ago

0.8.2

12 months ago

0.8.1

12 months ago

0.8.0

12 months ago