File tree Expand file tree Collapse file tree 1 file changed +10
-11
lines changed Expand file tree Collapse file tree 1 file changed +10
-11
lines changed Original file line number Diff line number Diff line change @@ -92,23 +92,22 @@ def set_password_linux(cfg: Configs) -> None:
9292 "`pass` is required to set password. Install e.g. sudo apt install pass."
9393 )
9494
95- try :
96- output = subprocess .run (
97- ["pass" , "ls" ],
98- shell = True ,
99- capture_output = True ,
100- text = True ,
101- )
102- except subprocess .CalledProcessError as e :
103- if "pass init" in e .stderr :
95+ output = subprocess .run (
96+ "pass ls" ,
97+ shell = True ,
98+ capture_output = True ,
99+ text = True ,
100+ )
101+ if output .returncode != 0 :
102+ if "pass init" in output .stderr :
104103 raise RuntimeError (
105104 "Password store is not initialized. "
106105 "Run `pass init <gpg-id>` before using `pass`."
107106 )
108107 else :
109108 raise RuntimeError (
110- f"\n --- STDOUT ---\n { output .stdout } " ,
111- f"\n --- STDERR ---\n { output .stderr } " ,
109+ f"\n --- STDOUT ---\n { output .stdout } "
110+ f"\n --- STDERR ---\n { output .stderr } "
112111 "Could not set up password with `pass`. See the error message above." ,
113112 )
114113
You can’t perform that action at this time.
0 commit comments