Gate.write.back: def of cswap-bend-cli@0.1.0.0 Import: import cswap-bend-cli@0.1.0.0/usage/gate.bend as Gate Lines 81-84 of cswap-bend-cli@0.1.0.0/usage/gate.bend: https://jend.leeeet.dev/read.txt?path=cswap-bend-cli@0.1.0.0/usage/gate.bend&start_line=81&end_line=84 import Base import cswap-bend-cli@0.1.0.0/fs.bend as Fs import cswap-bend-cli@0.1.0.0/b64.bend as B64 import cswap-bend-cli@0.1.0.0/fs/write.bend as FsW import cswap-bend-cli@0.1.0.0/json.bend as Json def write.back(+path: String, +old_text: String, +new: String, +acct: Json.Json) -> IO(Fs.Res(Gated)): IO.bind(Fs.Res(Unit), Fs.Res(Gated), FsW.write_atomic(path ++ ".prev", old_text, "600"), u => IO.bind(Fs.Res(Unit), Fs.Res(Gated), FsW.write_atomic(path, B64.encode(new), "600"), w => done.g(gated.ok_a(new, Some{new}, acct)))) Uses (13): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=IO https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=IO.bind https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Maybe 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=Unit 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/fs/write.bend&name=write_atomic https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/fs.bend&name=Res https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/json.bend&name=Json https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/usage/gate.bend&name=Gated https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/usage/gate.bend&name=done.g https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/usage/gate.bend&name=gated.ok_a