temp-postgres 0.1.0

temporary postgres instance meant for unit tests
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use crate::Error;
use crate::error::ErrorInner;

pub async fn run_command(name: &str, command: &mut tokio::process::Command) -> Result<(), Error> {
	// TODO: Redirect stdout and stderr to the same pipe to get properly interleaved output.
	let output = command.output()
		.await
		.map_err(|e| ErrorInner::RunCommand(name.to_owned(), e))?;
	if output.status.success() {
		Ok(())
	} else {
		Err(ErrorInner::CommandFailed(name.to_owned(), output).into())
	}
}