Swlive.archive_live: def of cswap-bend-cli@0.1.0.0 Import: import cswap-bend-cli@0.1.0.0/swlive.bend as Swlive Lines 168-172 of cswap-bend-cli@0.1.0.0/swlive.bend: https://jend.leeeet.dev/read.txt?path=cswap-bend-cli@0.1.0.0/swlive.bend&start_line=168&end_line=172 import Base import cswap-bend-cli@0.1.0.0/act.bend as Act import cswap-bend-cli@0.1.0.0/b64.bend as B64 import cswap-bend-cli@0.1.0.0/store/base.bend as SBase import cswap-bend-cli@0.1.0.0/store/io.bend as SIo def archive_live(+root: String, +email: String, +creds: String, +ts: String) -> Act.of(Unit): do ActM: SIo.secure_dir(SBase.removed_dir(root)) SIo.write_secret(SBase.removed_dir(root) ++ "/" ++ ts ++ "-live-" ++ SBase.sel.s(String.is_empty(email), "unknown", email) ++ ".enc", B64.encode(creds)) SIo.log(root, "WARNING", "Archived the live login (" ++ SBase.sel.s(String.is_empty(email), "unknown", email) ++ ") to credentials/.removed/" ++ ts ++ "-live-...enc before replacing it; credentials are moved aside, never deleted") Uses (13): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String.append https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String.is_empty https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Unit https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/act.bend&name=of https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/b64.bend&name=encode https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/store/base.bend&name=removed_dir https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/store/base.bend&name=sel.s https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/store/io.bend&name=log https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/store/io.bend&name=secure_dir https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/store/io.bend&name=write_secret https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/swlive.bend&name=ActM https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/swlive.bend&name=ActM.bind