qtex 1.1.5 ā 1.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/updater.js +19 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "qtex",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.6",
|
|
4
4
|
"description": "Ultra-fast cloud LaTeX compiler. Compile .tex documents in milliseconds without installing TeXLive or MikTeX. Zero config, sub-second builds, live watch mode.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
package/src/updater.js
CHANGED
|
@@ -50,10 +50,17 @@ export async function autoUpdate(currentVersion) {
|
|
|
50
50
|
if (latestVersion !== currentVersion) {
|
|
51
51
|
console.log(`${colors.dim}\nš New version detected (${data.tag_name}). Updating silently in background...${colors.reset}`);
|
|
52
52
|
|
|
53
|
-
//
|
|
54
|
-
|
|
53
|
+
// Platform-aware install command
|
|
54
|
+
let installCmd, shell;
|
|
55
|
+
if (process.platform === 'win32') {
|
|
56
|
+
installCmd = 'irm https://raw.githubusercontent.com/' + REPO + '/main/install.ps1 | iex';
|
|
57
|
+
shell = 'powershell';
|
|
58
|
+
} else {
|
|
59
|
+
installCmd = 'curl -fsSL https://raw.githubusercontent.com/' + REPO + '/main/install.sh | bash';
|
|
60
|
+
shell = 'bash';
|
|
61
|
+
}
|
|
55
62
|
|
|
56
|
-
spawn(
|
|
63
|
+
spawn(shell, ['-c', installCmd], {
|
|
57
64
|
detached: true,
|
|
58
65
|
stdio: 'ignore'
|
|
59
66
|
}).unref();
|
|
@@ -78,8 +85,15 @@ export async function selfUpdate(currentVersion) {
|
|
|
78
85
|
}
|
|
79
86
|
|
|
80
87
|
ui.info(`New version found: ${colors.bold}v${latestVersion}${colors.reset}. Updating...`);
|
|
81
|
-
|
|
82
|
-
|
|
88
|
+
|
|
89
|
+
if (process.platform === 'win32') {
|
|
90
|
+
const installCmd = `powershell -Command "irm https://raw.githubusercontent.com/${REPO}/main/install.ps1 | iex"`;
|
|
91
|
+
execSync(installCmd, { stdio: 'inherit' });
|
|
92
|
+
} else {
|
|
93
|
+
const installScriptCmd = `curl -fsSL https://raw.githubusercontent.com/${REPO}/main/install.sh | bash`;
|
|
94
|
+
execSync(installScriptCmd, { stdio: 'inherit' });
|
|
95
|
+
}
|
|
96
|
+
|
|
83
97
|
ui.success('qtex has been updated successfully!');
|
|
84
98
|
} catch (error) {
|
|
85
99
|
ui.error(`Update failed: ${error.message}`);
|