Skip to content

Commit

Permalink
fix(snorun): chorder of promise
Browse files Browse the repository at this point in the history
  • Loading branch information
snomiao committed Jul 3, 2022
1 parent c69e74e commit 55c4cfa
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
9 changes: 4 additions & 5 deletions packages/snorun/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "snorun",
"version": "1.1.3",
"version": "1.1.4",
"description": "Run & interact with shell command like in node without pain.",
"keywords": [
"async",
Expand Down Expand Up @@ -34,12 +34,11 @@
"lib"
],
"scripts": {
"build": "snobuild",
"prepack": "npm run build",
"test": "echo \"Error: no test specified\" && exit 1"
"build": "snobuild --lib",
"prepack": "npm run build"
},
"devDependencies": {
"snobuild": "^2.4.2"
"snobuild": "2.4.2"
},
"gitHead": "ca1c2db9974aa48a03d7695327ba73367192028c"
}
2 changes: 1 addition & 1 deletion packages/snorun/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ export default function snorun(cmd: string | string[], { echo = true, echoPrefix
const { promise: stderr, resolve: err } = usePromise<string>();
// todo: keep colors
const p = exec(execCommand, (error, stdout, stderr) => {
error ? succ(false) : succ(true);
err(stderr.trimEnd());
out(stdout.trimEnd());
error ? succ(false) : succ(true);
});
p.stderr.pipe(process.stderr);
p.stdout.pipe(process.stdout);
Expand Down
8 changes: 4 additions & 4 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 55c4cfa

Please sign in to comment.