mirror of
https://github.com/lune-org/lune.git
synced 2025-05-04 10:43:57 +01:00
feat(tests): fix superuser command syntax
This commit is contained in:
parent
be6b3f46fb
commit
ee51f187b3
1 changed files with 2 additions and 1 deletions
|
@ -16,10 +16,11 @@ macro_rules! create_tests {
|
||||||
// For the formatTime test, we need to enable the fr_FR locale for UTF-8 for the test to pass
|
// For the formatTime test, we need to enable the fr_FR locale for UTF-8 for the test to pass
|
||||||
if stringify!($name) == "datetime_format_time" {
|
if stringify!($name) == "datetime_format_time" {
|
||||||
// Inherits the credentials from parent stdin
|
// Inherits the credentials from parent stdin
|
||||||
let out = Command::new("sudo").arg("-S").arg("echo 'fr_FR.UTF-8 UTF-8' >> /etc/locale.gen").stdin(Stdio::inherit()).output().await?;
|
let out = Command::new("sudo").arg("-S").arg("bash").arg("-c").arg("echo").arg("'fr_FR.UTF-8 UTF-8' >> /etc/locale.gen\"").stdin(Stdio::inherit()).output().await?;
|
||||||
|
|
||||||
if !out.status.success() {
|
if !out.status.success() {
|
||||||
eprintln!("ERROR: Failed to write locale info to /etc/locale.gen, could not run as root");
|
eprintln!("ERROR: Failed to write locale info to /etc/locale.gen, could not run as root");
|
||||||
|
eprintln!("{}", String::from_utf8_lossy(&out.stderr));
|
||||||
return Ok(ExitCode::FAILURE);
|
return Ok(ExitCode::FAILURE);
|
||||||
} else {
|
} else {
|
||||||
if !Command::new("sudo").arg("locale-gen").output().await?.status.success() {
|
if !Command::new("sudo").arg("locale-gen").output().await?.status.success() {
|
||||||
|
|
Loading…
Add table
Reference in a new issue