Compare commits
3 Commits
958a729880
...
v1.1.3
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a93f3ad9f6 | ||
|
|
b0407d6519 | ||
|
|
c484f2deb8 |
2
Cargo.lock
generated
2
Cargo.lock
generated
@@ -1203,7 +1203,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "ostiary"
|
||||
version = "1.1.2"
|
||||
version = "1.1.3"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"base64",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "ostiary"
|
||||
version = "1.1.2"
|
||||
version = "1.1.3"
|
||||
edition = "2024"
|
||||
|
||||
[dependencies]
|
||||
|
||||
@@ -108,8 +108,8 @@ fi
|
||||
|
||||
echo ""
|
||||
ok "Launching ${BINARY}..."
|
||||
if tty_dev=$(tty 2>/dev/null); then
|
||||
exec "$INSTALL_DIR/$BINARY" <"$tty_dev" >"$tty_dev" 2>"$tty_dev"
|
||||
if { true </dev/tty; } 2>/dev/null; then
|
||||
exec "$INSTALL_DIR/$BINARY"
|
||||
else
|
||||
ok "Run: $BINARY"
|
||||
fi
|
||||
|
||||
14
src/main.rs
14
src/main.rs
@@ -172,17 +172,15 @@ async fn run_exec(
|
||||
fn prompt_first_endpoint() -> Result<(String, String)> {
|
||||
use std::io::{BufRead, BufReader, Write};
|
||||
|
||||
// Open /dev/tty directly so input works even when launched via `curl | bash`
|
||||
// (where stdin is the pipe carrying the script, not the keyboard).
|
||||
let tty = std::fs::OpenOptions::new()
|
||||
.read(true)
|
||||
.write(true)
|
||||
.open("/dev/tty")
|
||||
// Open /dev/tty read-only for keyboard input so the wizard works even when
|
||||
// stdin is a pipe (e.g. `curl | bash`). Writing goes through stdout so we
|
||||
// don't touch the terminal's write-side state before crossterm takes over.
|
||||
let tty_in = std::fs::File::open("/dev/tty")
|
||||
.map_err(|e| anyhow::anyhow!(
|
||||
"Не удалось открыть терминал ({e}). Запустите ostiary напрямую."
|
||||
))?;
|
||||
let mut out = tty.try_clone()?;
|
||||
let mut reader = BufReader::new(tty);
|
||||
let mut reader = BufReader::new(tty_in);
|
||||
let mut out = std::io::stdout();
|
||||
|
||||
writeln!(out)?;
|
||||
writeln!(out, " ╔══════════════════════════════════╗")?;
|
||||
|
||||
Reference in New Issue
Block a user