feat: share env files as encrypted links #54
@@ -229,7 +229,7 @@ func (m *Model) offerShare(r ref.Ref) tea.Cmd {
|
|||||||
m.st.Muted.Render(plural(s.Files, "env file")) + from,
|
m.st.Muted.Render(plural(s.Files, "env file")) + from,
|
||||||
m.st.Muted.Render("encrypted with ") + m.refLabel(s.Key),
|
m.st.Muted.Render("encrypted with ") + m.refLabel(s.Key),
|
||||||
}, []option{
|
}, []option{
|
||||||
{key: "o", label: "Decrypt them…", tip: "reads the secret, then asks before saving", run: func(m *Model) tea.Cmd { return m.openShare(s) }},
|
{key: "o", label: "Decrypt…", tip: "reads the secret, then asks before saving", run: func(m *Model) tea.Cmd { return m.openShare(s) }},
|
||||||
})
|
})
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@@ -287,9 +287,9 @@ func (m *Model) askShareDir(msg shareOpenedMsg) tea.Cmd {
|
|||||||
}
|
}
|
||||||
in.SetValue(dir)
|
in.SetValue(dir)
|
||||||
in.CursorEnd()
|
in.CursorEnd()
|
||||||
lines := []string{m.st.Muted.Render("Their paths are from the repo's root.")}
|
lines := []string{m.st.Muted.Render("Paths are from the repo's root.")}
|
||||||
if msg.sealed.Repo != "" {
|
if msg.sealed.Repo != "" {
|
||||||
lines = append([]string{m.st.Muted.Render(msg.sealed.Repo + " isn't among your repos: save them where?")}, lines...)
|
lines = append([]string{m.repoLabel(msg.sealed.Repo) + m.st.Muted.Render(" isn't among your repos. Save where?")}, lines...)
|
||||||
}
|
}
|
||||||
m.prompt = &modal{
|
m.prompt = &modal{
|
||||||
title: "Save the files", input: &in, lines: lines,
|
title: "Save the files", input: &in, lines: lines,
|
||||||
@@ -344,9 +344,9 @@ func (m *Model) offerWrite(files []share.File, dir string) {
|
|||||||
var opts []option
|
var opts []option
|
||||||
switch {
|
switch {
|
||||||
case exist == 0:
|
case exist == 0:
|
||||||
opts = append(opts, option{key: "w", label: "Save them", run: write(false)})
|
opts = append(opts, option{key: "w", label: "Save", run: write(false)})
|
||||||
case exist == len(targets):
|
case exist == len(targets):
|
||||||
opts = append(opts, option{key: "w", label: "Replace " + map[bool]string{true: "it", false: "them"}[exist == 1], run: write(false)})
|
opts = append(opts, option{key: "w", label: "Replace", run: write(false)})
|
||||||
default:
|
default:
|
||||||
opts = append(opts,
|
opts = append(opts,
|
||||||
option{key: "w", label: fmt.Sprintf("Save all, replacing %d", exist), run: write(false)},
|
option{key: "w", label: fmt.Sprintf("Save all, replacing %d", exist), run: write(false)},
|
||||||
|
|||||||
Reference in new issue
Block a user