fork/gdu

git clone https://git.julia.blue/fork/gdu

Daniel Mildefeat: allow scanning multiple directories (#653)34f3996

master
648 B37 linesraw
1package tui
2
3import (
4	"os"
5)
6
7func getShellBin() string {
8	shellbin, ok := os.LookupEnv("COMSPEC")
9	if !ok {
10		shellbin = "C:\\WINDOWS\\System32\\cmd.exe"
11	}
12	return shellbin
13}
14
15func (ui *UI) spawnShell() {
16	if ui.currentDir == nil {
17		return
18	}
19	if ui.atVirtualRoot() {
20		ui.showMessage("Shell cannot be spawned at the virtual top level directory")
21		return
22	}
23
24	ui.app.Stop()
25
26	if err := os.Chdir(ui.currentDirPath); err != nil {
27		ui.showErr("Error changing directory", err)
28		return
29	}
30	if err := ui.exec(getShellBin(), nil, os.Environ()); err != nil {
31		ui.showErr("Error executing shell", err)
32	}
33}
34
35func stopProcess() error {
36	return nil
37}