Giter VIP home page Giter VIP logo

demorunner's Introduction

demorunner

sh script to automate shell controlled demos.

This script executes a sequence of shell commands saved in a separate file (this file name is provided as an input paramater for the script).

The goal of the script is to offer a pre-packaged demo experience controlled by the the operartor with control over speed and text colors for better clarity for the final user.

The inital version allows for execution of extra commands during the demo and the possibility to start the demo from a specific line number (where feasible).

Run the script without arguments to show the help. (Also copied below)

prerequisites

Install pv:

brew install pv

run sample commands

Optionally add a line number at the end to start at a different line

source ./demorunner.sh sample_commands.txt

Optionally add a line number at the end to start at a different line

source ./demorunner.sh sample_commands.txt 2

demorunner.sh usage instructions:

$ demorunner.sh

This utility enables the simulation of 'live typing' for command-line driven demos by echoing and executing
a list of commands that you provide in a 'commands file'.

Usage:
source ./demorunner.sh (commands-file) [start-with-line-number]

Command-line arguments:
  commands-file           - Name of the file with the list of commands to execute. Required.
  start-with-line-number  - Line number in the commands file at which to begin execution. Optional. Default is 1.
                            #_ECHO_ON & #_ECHO_OFF commands above the starting line will still be respected, but
                            other lines will be ignored.

The following flags can be used in the commands file:
  #_ECHO_ON   - Turns on echoing and execution of subsequent commands. Must be placed in its own line.
                When #_ECHO_ON is enabled, user must press the Return key once to echo the next command, and again
                to execute it. This is the default mode.
  #_ECHO_OFF  - Turns off echoing of subsequent commands. Commands will be executed immediately, without user input.
                Must be placed in its own line.
  #_ECHO_#    - Strips tag and echoes command starting from #. Must be placed at the beginning of the line.

Otherwise, lines starting with # will be ignored.

The following environment variables can be used to modify the behavior of the script:
  DEMO_COLOR  - May be yellow, blue, or white. Default is yellow.
  DEMO_DELAY  - Controls the rate of the echoing of commands to simulate live typing. Default is 10.
                Set to 0 to disable rate-limiting. Increase the setting to make typing appear faster.

During execution of your commands file, you may also type a custom command at any time. Once your custom command is
executed, press Return at the next empty prompt to continue with the next command from the commands file.

--- Known issues/To-do List:

- Up/Down/Left/Right arrows have no effect.
- Tab/autocompletion does not work.

limitations

  • Up/Down/Left/Right arrows have no effect
  • Tab/autocompletion does not work

We are not sure when we'll have a chance to implement arrows and tabbing, but if you want to give it a shot, we'd love your contributions via a pull request!

demorunner's People

Contributors

ciberkleid avatar mgbrodi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.