🚀. Socket Launch Week Day 2:Introducing Manifest Alerts.Learn more
Sign In

codexctl

Package Overview
Dependencies
Maintainers
1
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

codexctl - npm Package Compare versions

Comparing version
0.4.5
to
0.4.6
+39
-18
codexctl.js

@@ -42,21 +42,42 @@ #!/usr/bin/env node

return new Promise((resolve, reject) => {
https.get(url, (res) => {
if (res.statusCode === 302 || res.statusCode === 301) {
download(res.headers.location).then(resolve).catch(reject);
return;
}
const file = fs.createWriteStream(path.join(binDir, 'download' + platform.ext));
res.pipe(file);
file.on('finish', () => {
if (platform.ext === '.zip') {
const { execSync } = require('child_process');
execSync(`powershell -Command "Expand-Archive -Path '${file.path}' -DestinationPath '${binDir}' -Force"`);
} else {
const { execSync } = require('child_process');
execSync(`tar -xzf '${file.path}' -C '${binDir}'`);
const doDownload = (downloadUrl) => {
https.get(downloadUrl, (res) => {
if (res.statusCode === 302 || res.statusCode === 301) {
const redirectUrl = res.headers.location;
if (!redirectUrl) {
reject(new Error('Redirect without location'));
return;
}
doDownload(redirectUrl);
return;
}
fs.unlinkSync(file.path);
resolve();
});
}).on('error', reject);
if (res.statusCode !== 200) {
reject(new Error(`Download failed with status ${res.statusCode}`));
return;
}
const file = fs.createWriteStream(path.join(binDir, 'download' + platform.ext));
res.pipe(file);
file.on('finish', () => {
try {
if (platform.ext === '.zip') {
const { execSync } = require('child_process');
execSync(`powershell -Command "Expand-Archive -Path '${file.path}' -DestinationPath '${binDir}' -Force"`, { stdio: 'ignore' });
} else {
const { execSync } = require('child_process');
execSync(`tar -xzf '${file.path}' -C '${binDir}'`, { stdio: 'ignore' });
}
fs.unlinkSync(file.path);
if (!fs.existsSync(binPath)) {
reject(new Error('Downloaded file not found after extraction'));
return;
}
resolve();
} catch (err) {
reject(err);
}
});
file.on('error', reject);
}).on('error', reject);
};
doDownload(url);
});

@@ -63,0 +84,0 @@ }

{
"name": "codexctl",
"version": "0.4.5",
"version": "0.4.6",
"description": "Codex CLI Profile Manager - Manage multiple AI CLI accounts",

@@ -5,0 +5,0 @@ "main": "index.js",