Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update usage in README.md due to eseca update #160

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ $ npm install --save listr
## Usage

```js
import execa from 'execa';
import { execa } from 'execa';
import Listr from 'listr';

const tasks = new Listr([
Expand All @@ -27,16 +27,16 @@ const tasks = new Listr([
return new Listr([
{
title: 'Checking git status',
task: () => execa.stdout('git', ['status', '--porcelain']).then(result => {
if (result !== '') {
task: () => execa('git', ['status', '--porcelain']).then(({stdout}) => {
if (stdout !== '') {
throw new Error('Unclean working tree. Commit or stash changes first.');
}
})
},
{
title: 'Checking remote history',
task: () => execa.stdout('git', ['rev-list', '--count', '--left-only', '@{u}...HEAD']).then(result => {
if (result !== '0') {
task: () => execa('git', ['rev-list', '--count', '--left-only', '@{u}...HEAD']).then(({stdout, exitCode}) => {
if (exitCode !== 0) {
throw new Error('Remote history differ. Please pull changes.');
}
})
Expand Down