Skip to content

Commit 24855e3

Browse files
committed
Add Readme
1 parent 95d24fa commit 24855e3

File tree

5 files changed

+37
-4
lines changed

5 files changed

+37
-4
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
__tests__
22
dist
33
node_modules
4+
.DS_Store

README.md

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# PWatch
2+
3+
Get notified when your processes finishes.
4+
5+
## Usage
6+
7+
Add `pwatch` at the end of your command.
8+
9+
```
10+
sleep 10 | pwatch
11+
```
12+
or
13+
14+
```
15+
sleep 10 && pwatch
16+
```
17+
or
18+
19+
```
20+
sleep 10; pwatch
21+
```
22+
23+
Or if you forget to call it when running your command
24+
25+
```
26+
$ scp somelargefile.tar.gz root@remotehost:~
27+
$ ps aux | grep scp
28+
justink 60132 0.0 0.2 3041904 31712 s018 S+ 12:15PM 0:00.20 scp somelargefile.tar.gz root@remotehost:~
29+
$ pwatch 60132
30+
```
31+
32+
Then get notified when that process finishes.
33+
![](assets/pwatchinaction.png)

assets/pwatchinaction.png

49.5 KB
Loading

package.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "pwatch",
3-
"version": "0.0.1",
3+
"version": "0.0.2",
44
"description": "Process Watcher",
55
"main": "./index.js",
66
"bin": {
@@ -9,7 +9,6 @@
99
"scripts": {
1010
"prepublish": "babel src --out-dir dist",
1111
"watch": "babel -w src --out-dir dist",
12-
"dev": "babel-node index.js",
1312
"test": "jest"
1413
},
1514
"author": "Justin Krup",

src/main.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ function handlePiped() {
2020

2121
function handlePid(pid) {
2222
if (!pid) {
23-
console.error('No pid specified');
24-
process.exit(1);
23+
notifier.notify('No pid specified');
24+
process.exit(0);
2525
}
2626
checkPid(pid);
2727
}

0 commit comments

Comments
 (0)