Commit graph

55 commits

Author SHA1 Message Date
Josh Soref
0d4a2270ec spelling: supporting 2019-10-14 11:09:51 +13:00
Félix Saparelli
5846b64020 [run] Further dry the ExecHandler 2019-01-26 17:32:48 +13:00
Félix Saparelli
3dd2f797ab [process] Remove some more unwrap 2019-01-26 17:26:33 +13:00
Félix Saparelli
6a23f77687 [run] Pass ops by reference when possible 2019-01-26 17:20:29 +13:00
Félix Saparelli
6f473bcd87 [meta] Run formatter 2019-01-26 15:15:27 +13:00
Magnus Bergmark
9fd25dd667
Use setsid() instead of setpgid()
This makes it possible to run commands that allocates TTYs and still
capture their output and reap the process on completion.

> setpgid — set process group ID for job control
> setsid — create session and set process group ID

With this in place, the `waitpid` call detects that the process has
exited even if the process allocated a TTY, and is able to unblock the
runner and continue.

Further, the output of the command is also shown in the controlling
terminal.
2019-01-17 13:21:27 +01:00
Félix Saparelli
ba23ed09f6 Fix tests 2018-09-09 16:16:40 +12:00
Félix Saparelli
dc712197c0 1.9.2: revert whitespace changes 2018-09-09 16:03:01 +12:00
Félix Saparelli
a6163cc599 Formatting 2018-09-08 20:08:36 +12:00
Félix Saparelli
7375db5ce9 Also wrap when there’s quotes but no whitespace 2018-08-22 08:17:36 +12:00
Félix Saparelli
21d4080183 Wrap whitespace in arguments
Fixes #82
Fixes #87
2018-08-22 07:15:20 +12:00
Oliver Jan Krylow
8de93a8fd2
Bumps __nix__ to __0.11.0__ in order to support OpenBSD 6.3+. 2018-07-30 21:20:12 +02:00
Matt Gathu
775eb47dde
fix (src/process.rs): fix cargo clippy linter warnings
This PR fixes lint warnings generated by cargo-clippy:

- **warning**: you should put `notify::ops::RENAME` between ticks in the documentation
- **warning**: use of `or_insert` followed by a function call

I have run `cargo test` and these changes do not break any of the tests :-)

reference:
--

* https://rust-lang-nursery.github.io/rust-clippy/v0.0.165/index.html#doc_markdown
* https://rust-lang-nursery.github.io/rust-clippy/v0.0.165/index.html#or_fun_call
* https://github.com/rust-lang-nursery/rust-clippy
2017-10-06 13:55:21 +03:00
James Kominick
8bd9bb3c25 detailed update information
issue #59
- Keep track of `notify::op::Op`s associated with each updated path
- Collect paths into `notify::op::Op` categories and pass them on as
  environment vars
- Set a COMMON_PATH and use relative paths if more than one unique
  path was touched
2017-09-09 13:55:44 -04:00
Lilian A. Moraru
e39256cfb2 Update dependencies and other small improvements 2017-08-26 22:07:06 +03:00
Matt Green
3fc501c4f0 Windows: fix waiting for job to finish; closes #55 2017-05-18 13:22:46 -04:00
Chris Aumann
f88f1b36c3 Refactor command assembly
Kudos to https://www.reddit.com/user/burntsushi from the /r/rust community!
See: https://www.reddit.com/r/rust/comments/64ic0q/idiomatic_string_processing/
2017-04-10 14:13:27 +02:00
Chris Aumann
df72aaf977 Use if-else statements instead of boolean match
This was a hint by `cargo clippy`
2017-04-10 00:20:57 +02:00
Chris Aumann
780b54b34e Port --no-shell to Windows 2017-04-10 00:20:57 +02:00
Chris Aumann
5a7ccf759b Adapt spawn() test for Unix 2017-04-10 00:20:27 +02:00
Chris Aumann
ee5e93e6af Add support for --no-shell option 2017-04-10 00:19:58 +02:00
Chris Aumann
5b486e2ae6 Remove deprecated comment (before_exec) 2017-04-06 22:54:02 +02:00
Chris Aumann
56ddfcbaee Apply rustfmt-0.8.1 2017-04-02 21:21:30 +02:00
Chris Aumann
a2f6b0013f Add windows compatibility 2017-04-02 21:19:53 +02:00
Chris Aumann
0a445c9f76 Move convert_to_libc() method to signal.rs 2017-04-02 21:19:53 +02:00
Chris Aumann
4adde457dd Actually use signal specified in --signal option 2017-04-02 21:19:53 +02:00
Chris Aumann
eebe966b50 Remove deprecated signal functions 2017-04-02 21:19:53 +02:00
Chris Aumann
24e9b0c1c5 Migrate to nix::sys::signal::Signal 2017-04-02 21:19:52 +02:00
Chris Aumann
68caf04269 First commit to add a generic --signal flag 2017-04-02 21:19:52 +02:00
Chris Aumann
f62c3724b2 Use before_exec as process_exec landed in stable 2017-03-24 17:11:24 +01:00
Matt Green
6b7351d45b Remove kill/wait tests as process handling is async now 2016-12-20 13:42:39 -05:00
Matt Green
09448cd91e Fix reap() hanging when child processes are still running 2016-12-20 13:21:24 -05:00
Matt Green
171132a722 rustfmt & clippy fixes 2016-12-20 12:20:21 -05:00
Matt Green
b2c809c87a SIGCHLD handling 2016-12-20 11:44:18 -05:00
Matt Green
9c65e816da Add -k option to send SIGKILL instead of SIGTERM; closes #31 2016-12-19 11:37:20 -05:00
Matt Green
154c23a5a4 Propagate SIGTSTP/SIGCONT to children 2016-12-14 20:19:58 -05:00
Matt Green
54baf4e384 Add process::spawn function 2016-11-23 12:59:56 -05:00
Matt Green
0e9dafffc8 Unix: pipe read/write handles EINTR 2016-11-16 20:18:46 -05:00
Matt Green
12557d11bf Fix setpgid() racing killpg()/waitpid() in tests 2016-11-16 08:55:15 -05:00
Matt Green
e4557e462b Wait for child process, not any child process in group 2016-11-15 22:43:51 -05:00
Matt Green
5b2858e6d6 Die quietly if exec() fails 2016-11-15 17:04:15 -05:00
Matt Green
3bf3086a29 Replace before_exec with fork/exec, removing Rust nightly requirement 2016-11-15 16:55:29 -05:00
Matt Green
48b0def80d Fix warnings in tests 2016-11-09 17:37:35 -05:00
Matt Green
2d2a8cb079 rustfmt 2016-11-09 17:25:52 -05:00
Matt Green
707fa2e952 Windows compilation fixes 2016-11-09 17:20:13 -05:00
Matt Green
cf0a98b7a5 Remove use of select! 2016-11-09 09:44:00 -05:00
David Raifaizen
dfe9dcc338 Refactoring get_longest_common_path to be simpler and more efficient 2016-11-05 08:42:45 -04:00
Matt Green
8f916c495f Apply clippy suggested fixes 2016-10-30 12:37:34 -04:00
Matt Green
69eedd4cc5 rustfmt fixes 2016-10-30 12:28:54 -04:00
Matt Green
d859b4b70e Drop threadpool dep (was spawning threads over and over) 2016-10-30 12:28:11 -04:00