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

Function installUpdate

webui/scripts/about.js:140–160  ·  view source on GitHub ↗

* Funtion to install update * @returns {void}

()

Source from the content-addressed store, hash-verified

138 * @returns {void}
139 */
140function installUpdate() {
141 showPrompt(getString("prompt_installing"));
142 let stdout = "";
143 const output = spawn('sh', [`${basePath}/common/get_extra.sh`, '--install-update'],
144 { env: { PATH: "$PATH:/data/adb/ap/bin:/data/adb/ksu/bin:/data/adb/magisk" } });
145 output.stdout.on('data', (data) => stdout += data);
146 output.stderr.on('data', (data) => {
147 console.error('Error during installation:', data);
148 });
149 output.on('exit', (code) => {
150 if (stdout.includes('No need to reboot')) {
151 window.location.reload();
152 }
153 if (code === 0) {
154 showPrompt(getString("prompt_installed"));
155 } else {
156 showPrompt(getString("prompt_install_fail"), false);
157 }
158 isDownloading = false;
159 });
160}

Callers 1

downloadUpdateFunction · 0.85

Calls 2

showPromptFunction · 0.90
getStringFunction · 0.90

Tested by

no test coverage detected