* Funtion to install update * @returns {void}
()
| 138 | * @returns {void} |
| 139 | */ |
| 140 | function 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 | } |
no test coverage detected