MCPcopy
hub / github.com/xpf0000/FlyEnv / handlePodmanVersion

Function handlePodmanVersion

src/render/components/VersionManager/podman/setup.ts:94–113  ·  view source on GitHub ↗
(row: PodmanTableRow)

Source from the content-addressed store, hash-verified

92 }
93
94 const handlePodmanVersion = async (row: PodmanTableRow) => {
95 if (PodmanSetup.installing) return
96 PodmanSetup.installing = true
97 PodmanSetup.installEnd = false
98 const fn = row.installed ? 'uninstall' : 'install'
99 const sh = join(window.Server.Static!, 'sh/podman-cmd.sh')
100 const copyfile = join(window.Server.Cache!, 'podman-cmd.sh')
101 const exists = await fs.existsSync(copyfile)
102 if (exists) await fs.remove(copyfile)
103 await fs.copyFile(sh, copyfile)
104 await fs.chmod(copyfile, '0777')
105 const params = [`${copyfile} ${fn} ${row.name};`]
106 await nextTick()
107 const execXTerm = new XTerm()
108 PodmanSetup.xterm = execXTerm
109 await execXTerm.mount(xtermDom.value!)
110 await execXTerm.send(params)
111 PodmanSetup.installEnd = true
112 PodmanSetup.installing = false
113 }
114
115 const xtermDom = ref<HTMLElement | null>(null)
116

Callers

nothing calls this directly

Calls 3

mountMethod · 0.95
sendMethod · 0.95
removeMethod · 0.65

Tested by

no test coverage detected