fix(core): tidy formatting and minor fixes across CLI, SNMP, HTTP server, migrations and packaging

This commit is contained in:
2026-01-29 17:10:17 +00:00
parent fda072d15e
commit ff2dc00f31
31 changed files with 693 additions and 362 deletions

View File

@@ -5,9 +5,9 @@
* Downloads the appropriate binary for the current platform from GitHub releases
*/
import { platform, arch } from 'os';
import { existsSync, mkdirSync, writeFileSync, chmodSync, unlinkSync } from 'fs';
import { join, dirname } from 'path';
import { arch, platform } from 'os';
import { chmodSync, existsSync, mkdirSync, unlinkSync, writeFileSync } from 'fs';
import { dirname, join } from 'path';
import { fileURLToPath } from 'url';
import https from 'https';
import { pipeline } from 'stream';
@@ -29,12 +29,12 @@ function getBinaryInfo() {
const platformMap = {
'darwin': 'macos',
'linux': 'linux',
'win32': 'windows'
'win32': 'windows',
};
const archMap = {
'x64': 'x64',
'arm64': 'arm64'
'arm64': 'arm64',
};
const mappedPlatform = platformMap[plat];
@@ -54,7 +54,7 @@ function getBinaryInfo() {
platform: mappedPlatform,
arch: mappedArch,
binaryName,
originalPlatform: plat
originalPlatform: plat,
};
}
@@ -122,7 +122,9 @@ async function main() {
const binaryInfo = getBinaryInfo();
if (!binaryInfo.supported) {
console.error(`❌ Error: Unsupported platform/architecture: ${binaryInfo.platform}/${binaryInfo.arch}`);
console.error(
`❌ Error: Unsupported platform/architecture: ${binaryInfo.platform}/${binaryInfo.arch}`,
);
console.error('');
console.error('Supported platforms:');
console.error(' • Linux (x64, arm64)');
@@ -185,7 +187,9 @@ async function main() {
console.error('You can try:');
console.error('1. Installing from source: https://code.foss.global/serve.zone/nupst');
console.error('2. Downloading the binary manually from the releases page');
console.error('3. Using the install script: curl -sSL https://code.foss.global/serve.zone/nupst/raw/branch/main/install.sh | sudo bash');
console.error(
'3. Using the install script: curl -sSL https://code.foss.global/serve.zone/nupst/raw/branch/main/install.sh | sudo bash',
);
// Clean up partial download
if (existsSync(binaryPath)) {
@@ -225,7 +229,7 @@ async function main() {
}
// Run the installation
main().catch(err => {
main().catch((err) => {
console.error(`❌ Installation failed: ${err.message}`);
process.exit(1);
});
});