File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -30,6 +30,7 @@ fn main() -> Result<(), Error> {
3030 bail ! ( "Must specify a userid argument, e.g.: `bpb init \" username <email>\" `" )
3131 }
3232 }
33+ Some ( "import" ) => import ( ) ,
3334 Some ( "upgrade" ) => upgrade ( ) ,
3435 Some ( "print" ) => print_public_key ( ) ,
3536 Some ( "--help" ) => print_help_message ( ) ,
@@ -145,6 +146,15 @@ fn upgrade() -> Result<(), Error> {
145146 config. write ( )
146147}
147148
149+ fn import ( ) -> Result < ( ) , Error > {
150+ let config = Config :: load ( ) ?;
151+ let service = config. service ( ) ;
152+ let account = config. user_id ( ) ;
153+
154+ let key = std:: env:: args ( ) . nth ( 2 ) . unwrap ( ) ;
155+ add_keychain_item ( service, account, & key)
156+ }
157+
148158fn legacy_keys_file ( ) -> String {
149159 std:: env:: var ( "BPB_KEYS" )
150160 . unwrap_or_else ( |_| format ! ( "{}/.bpb_keys.toml" , std:: env:: var( "HOME" ) . unwrap( ) ) )
You can’t perform that action at this time.
0 commit comments