Use " " instead of "" for the empty key so sh doesn't interpret it as falsy

This commit is contained in:
Luke Parker
2024-03-23 17:38:50 -04:00
parent 2a31d8552e
commit 5ea3b1bf97
5 changed files with 5 additions and 5 deletions

View File

@@ -8,7 +8,7 @@ pub struct Keystore(sr25519::Pair);
impl Keystore {
pub fn from_env() -> Option<Self> {
let mut key_hex = serai_env::var("KEY")?;
if key_hex.is_empty() {
if key_hex.trim().is_empty() {
None?;
}
let mut key = hex::decode(&key_hex).expect("KEY from environment wasn't hex");