Skip to content

Commit

Permalink
Merge pull request #56 from yukihirop/fix/panic
Browse files Browse the repository at this point in the history
Fix/panic
  • Loading branch information
yukihirop committed Mar 2, 2024
2 parents e5c478f + 6c9c49e commit 3dc86f7
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 6 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# CHANGELOG

## v0.3.2

- fix #55

## v0.3.1

- [Breaking] fix `port_for` logic.
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ultraman"
version = "0.3.1"
version = "0.3.2"
authors = ["yukihirop <te108186@gmail.com>"]
repository = "https://github.com/yukihirop/ultraman"
edition = "2018"
Expand Down
16 changes: 16 additions & 0 deletions docs/DEVELOP.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Development

## Example

```bash
cd example/start
cargo run start -p ./Procfile
```

## Release

```bash
cargo build
cargo bump
cargo publish --dry-run
```
2 changes: 2 additions & 0 deletions example/start/Procfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ exit_0: ./fixtures/exit_0.sh
exit_1: ./fixtures/exit_1.sh
loop: ./fixtures/loop.sh $MESSAGE
web: bundle exec puma -p $PORT -C ./config/puma.rb
early_out: seq 100
sleep: sleep 20
5 changes: 4 additions & 1 deletion src/process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ impl Process {
String::from("PORT"),
port_for(&env_path, port, concurrency_index).to_string(),
);
read_env.insert(String::from("PS"), ps_for(process_name, concurrency_index + 1));
read_env.insert(
String::from("PS"),
ps_for(process_name, concurrency_index + 1),
);
let shell = os_env::var("SHELL").expect("$SHELL is not set");

Process {
Expand Down
12 changes: 9 additions & 3 deletions src/stream_read.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,17 @@ impl PipeStreamReader {
}
Ok(_) => {
if byte[0] == 0x0A {
tx.send(match String::from_utf8(buf.clone()) {
match tx.send(match String::from_utf8(buf.clone()) {
Ok(line) => Ok(PipedLine::Line(line)),
Err(err) => Err(PipeError::NotUtf8(err)),
})
.unwrap();
}) {
Ok(_) => {}
Err(e) => {
println!("Failed to send message: {}", e);
break;
}
}

buf.clear()
} else {
buf.push(byte[0])
Expand Down

0 comments on commit 3dc86f7

Please sign in to comment.