@@ -159,14 +159,16 @@ 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':
|
}
|
||||||
|
case 'file': {
|
||||||
downloadResult = await this.installFromFile(parsed);
|
downloadResult = await this.installFromFile(parsed);
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
case 'registry':
|
case 'registry':
|
||||||
default:
|
default: {
|
||||||
// Resolve version first
|
// Resolve version first
|
||||||
const resolvedVersion = await this.registry.resolveVersion(name, version || 'latest');
|
const resolvedVersion = await this.registry.resolveVersion(name, version || 'latest');
|
||||||
|
|
||||||
@@ -182,6 +184,7 @@ class PackageManager {
|
|||||||
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