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