Signed-off-by: ale <ale@manalejandro.com>
Este commit está contenido en:
ale
2025-08-19 04:19:53 +02:00
padre b52ad0d2ea
commit 44ca9ffc30

Ver fichero

@@ -159,28 +159,31 @@ class PackageManager {
let downloadResult;
switch (source) {
case 'git':
downloadResult = await this.downloadFromGit(parsed);
break;
case 'file':
downloadResult = await this.installFromFile(parsed);
break;
case 'registry':
default:
// Resolve version first
const resolvedVersion = await this.registry.resolveVersion(name, version || 'latest');
case 'git': {
downloadResult = await this.downloadFromGit(parsed);
break;
}
case 'file': {
downloadResult = await this.installFromFile(parsed);
break;
}
case 'registry':
default: {
// Resolve version first
const resolvedVersion = await this.registry.resolveVersion(name, version || 'latest');
// Security check
if (options.secure !== false) {
// Simple security check - skip for now
}
// Security check
if (options.secure !== false) {
// Simple security check - skip for now
}
// Download and store
downloadResult = await this.registry.download({ name, version: resolvedVersion });
// Download and store
downloadResult = await this.registry.download({ name, version: resolvedVersion });
// Update the version to the resolved one
version = resolvedVersion;
break;
// Update the version to the resolved one
version = resolvedVersion;
break;
}
}
packageData = downloadResult.data;
@@ -698,17 +701,17 @@ class PackageManager {
// Extract package name from URL
if (url.includes('github.com/')) {
const match = url.match(/github\.com\/([^\/]+)\/([^\/]+?)(\.git)?$/);
const match = url.match(/github\.com\/([^/]+)\/([^/]+?)(\.git)?$/);
if (match) {
name = match[2].replace('.git', '');
}
} else if (url.includes('gitlab.com/')) {
const match = url.match(/gitlab\.com\/([^\/]+)\/([^\/]+?)(\.git)?$/);
const match = url.match(/gitlab\.com\/([^/]+)\/([^/]+?)(\.git)?$/);
if (match) {
name = match[2].replace('.git', '');
}
} else if (url.includes('bitbucket.org/')) {
const match = url.match(/bitbucket\.org\/([^\/]+)\/([^\/]+?)(\.git)?$/);
const match = url.match(/bitbucket\.org\/([^/]+)\/([^/]+?)(\.git)?$/);
if (match) {
name = match[2].replace('.git', '');
}
@@ -1031,7 +1034,7 @@ class PackageManager {
const { spawn } = require('child_process');
await new Promise((resolve, reject) => {
await new Promise((resolve, _reject) => {
const npmScript = spawn('npm', ['run', 'postinstall'], {
cwd: packageDir,
stdio: 'inherit',
@@ -1061,7 +1064,7 @@ class PackageManager {
const { spawn } = require('child_process');
await new Promise((resolve, reject) => {
await new Promise((resolve, _reject) => {
const npmScript = spawn('npm', ['run', 'install'], {
cwd: packageDir,
stdio: 'inherit',