MCPcopy
hub / github.com/SurgeDM/Surge / handleBatchFileSelection

Method handleBatchFileSelection

internal/tui/update_filepicker.go:9–23  ·  view source on GitHub ↗
(path string)

Source from the content-addressed store, hash-verified

7)
8
9func (m *RootModel) handleBatchFileSelection(path string) (tea.Model, tea.Cmd) {
10 urls, err := utils.ReadURLsFromFile(path)
11 if err != nil {
12 m.addLogEntry(LogStyleError.Render("\u2716 Failed to read batch file: " + err.Error()))
13 m.resetFilepickerToDirMode()
14 m.state = DashboardState
15 return m, nil
16 }
17 m.pendingBatchURLs = urls
18 m.inputs[2].SetValue(m.defaultDownloadPath())
19 m.batchFilePath = path
20 m.resetFilepickerToDirMode()
21 m.state = BatchConfirmState
22 return m, nil
23}
24
25func (m RootModel) updateFilePicker(msg tea.KeyPressMsg) (tea.Model, tea.Cmd) {
26 if key.Matches(msg, m.keys.FilePicker.Cancel) {

Callers 2

UpdateMethod · 0.95
updateBatchFilePickerMethod · 0.95

Calls 6

addLogEntryMethod · 0.95
defaultDownloadPathMethod · 0.95
ReadURLsFromFileFunction · 0.92
ErrorMethod · 0.80
RenderMethod · 0.45

Tested by

no test coverage detected