MCPcopy
hub / github.com/KOWX712/Tricky-Addon-Update-Target-List / downloadUpdate

Function downloadUpdate

webui/scripts/about.js:120–134  ·  view source on GitHub ↗

* Funtion to download update * @param {string} link - link of file to download * @returns {void}

(link)

Source from the content-addressed store, hash-verified

118 * @returns {void}
119 */
120function downloadUpdate(link) {
121 showPrompt(getString("prompt_downloading"), true, 20000);
122 const download = spawn('sh', [`${basePath}/common/get_extra.sh`, '--get-update', `${link}`],
123 { env: { PATH: "$PATH:/data/adb/ap/bin:/data/adb/ksu/bin:/data/adb/magisk:/data/data/com.termux/files/usr/bin" } });
124 download.stdout.on('data', (data) => console.log(data))
125 download.stderr.on('data', (data) => console.log(data))
126 download.on('exit', (code) => {
127 if (code === 0) {
128 installUpdate();
129 } else {
130 showPrompt(getString("prompt_download_fail"), false);
131 isDownloading = false;
132 }
133 });
134}
135
136/**
137 * Funtion to install update

Callers 1

about.jsFile · 0.85

Calls 3

showPromptFunction · 0.90
getStringFunction · 0.90
installUpdateFunction · 0.85

Tested by

no test coverage detected