script changes
This commit is contained in:
parent
1745e834af
commit
eaa112e0a8
2 changed files with 11 additions and 11 deletions
|
@ -30,8 +30,14 @@ def notify(
|
|||
|
||||
|
||||
def read_secret_file(secret: str) -> str:
|
||||
path = f"/run/secrets/{secret}"
|
||||
if not os.path.exists(path):
|
||||
raise FileNotFoundError(f"Secret file {path} does not exist.")
|
||||
with open(f"/run/secrets/{secret}", "r") as f:
|
||||
return f.read().strip()
|
||||
secret = f.read().strip()
|
||||
if not secret:
|
||||
raise ValueError(f"Secret file {path} is empty.")
|
||||
return secret
|
||||
|
||||
|
||||
def does_desktop_entry_exist(desktop_entry: str) -> bool:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue