Code Monkey home page Code Monkey logo

too's Introduction

too

Go codecov Go Report Card

The opposite of tee, merges multiple command io stream and controls like 1 command.

-> command 1 stream ─┐
-> command 2 stream ─┤
                     └─ stdout/stderr/SIGINT to kill both

install

% go get -u github.com/otiai10/too
# then just hit `too`

why?

When you need to start 2 file watchers, and kill them at the same time, like this

% nohup rails server &
% nohup npm start-webpack &
# then
% pkill rails
% pkill start-webpack
# <- annoying :(

usage

% too
> rails server # return key
> npm start-webpack # return key
> # return key again

[0] ... # Rails log here
[1] ... # npm log here

# To kill both, just Ctrl+C once!

examples

by interactive mode

i

by one-line mode

o

in both ways, you can kill all the commands by just 1 Ctrl+C

too's People

Contributors

otiai10 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

tubbz-alt

too's Issues

[bug] npm watcher process not detecting file changes

% too -cmd="./node_modules/.bin/webpack --config ./client/webpack.config.js --watch --progress"  -cmd="goapp serve app"                                                                                                                                                                                                                                                    
[0] ./node_modules/.bin/webpack
[0] ./node_modules/.bin/webpack	Webpack is watching the files…
[0] ./node_modules/.bin/webpack
# <-- should build here!
[1] goapp	INFO     2017-08-01 04:43:55,293 devappserver2.py:116] Skipping SDK update check.
[1] goapp	INFO     2017-08-01 04:43:55,328 api_server.py:297] Starting API server at: http://localhost:54037
[1] goapp	INFO     2017-08-01 04:43:55,334 dispatcher.py:209] Starting module "default" running at: http://localhost:8080
[1] goapp	INFO     2017-08-01 04:43:55,337 admin_server.py:116] Starting admin server at: http://localhost:8000
% too -cmd="npm start" -cmd="goapp serve app"
[0] npm
[0] npm	> [email protected] prestart /Users/otiai10/proj/go/src/github.com/otiai10/chant
[0] npm	> yarn install
[0] npm
[0] npm	yarn install v0.21.3
[0] npm	[1/4] Resolving packages...
[0] npm	success Already up-to-date.
[0] npm	Done in 0.42s.
[1] goapp	INFO     2017-08-01 04:42:06,948 devappserver2.py:116] Skipping SDK update check.
[0] npm
[0] npm	> [email protected] start /Users/otiai10/proj/go/src/github.com/otiai10/chant
[0] npm	> webpack --config ./client/webpack.config.js --watch --progress
[0] npm
[1] goapp	INFO     2017-08-01 04:42:06,979 api_server.py:297] Starting API server at: http://localhost:53982
[1] goapp	INFO     2017-08-01 04:42:06,982 dispatcher.py:209] Starting module "default" running at: http://localhost:8080
[1] goapp	INFO     2017-08-01 04:42:06,984 admin_server.py:116] Starting admin server at: http://localhost:8000
[0] npm
[0] npm	Webpack is watching the files…
[0] npm
# <-- should build here

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.