Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

execly

werle6MIT0.0.1

Streaming process executor, local and remote

exec, spawn, remote, child, ssh, process

readme

execly

Streaming process executor, local and remote

install

$ npm install execly

example

deploy.sh on remote

#!/bin/bash

DEST="$1"
REMOTE="$2"
BRANCH="$3"

echo "  ... Cloning remote into destiation '$DEST'"
git clone $REMOTE $DEST
cd $DEST
echo "  ... Checking out branch '$BRANCH'"
git checkout $BRANCH
echo "  ... Fetching latest"
git pull --rebase origin $BRANCH
var exec = require('execly');

function deploy (opts) {
  return exec(opts.host, opts.script, [
    opts.dir, // $DEST
    opts.remote, // $REMOTE
    opts.branch || 'master' // $BRANCH
  ], {
    privateKey: require('fs').readFileSync('/path/to/key/file')
  });
}

deploy({
  host: 'user@prod.server.com',
  dir: '/srv/www', remote: 'git@host.com:app.git'
})
.pipe(process.stdout);

usage

execly(host, command, args, opts); // => Stream

license

MIT