handle scoped packages
This commit is contained in:
parent
8c7d5b1d52
commit
753e021941
3
package-lock.json
generated
3
package-lock.json
generated
@ -63,7 +63,8 @@
|
|||||||
"@types/semver": {
|
"@types/semver": {
|
||||||
"version": "7.3.4",
|
"version": "7.3.4",
|
||||||
"resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.3.4.tgz",
|
"resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.3.4.tgz",
|
||||||
"integrity": "sha512-+nVsLKlcUCeMzD2ufHEYuJ9a2ovstb6Dp52A5VsoKxDXgvE051XgHI/33I1EymwkRGQkwnA0LkhnUzituGs4EQ=="
|
"integrity": "sha512-+nVsLKlcUCeMzD2ufHEYuJ9a2ovstb6Dp52A5VsoKxDXgvE051XgHI/33I1EymwkRGQkwnA0LkhnUzituGs4EQ==",
|
||||||
|
"dev": true
|
||||||
},
|
},
|
||||||
"@types/tar": {
|
"@types/tar": {
|
||||||
"version": "4.0.4",
|
"version": "4.0.4",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@squeebot/core",
|
"name": "@squeebot/core",
|
||||||
"version": "3.0.0",
|
"version": "3.0.1",
|
||||||
"description": "Squeebot v3 core for the execution environment",
|
"description": "Squeebot v3 core for the execution environment",
|
||||||
"main": "lib/index.js",
|
"main": "lib/index.js",
|
||||||
"module": "lib/",
|
"module": "lib/",
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import * as fs from 'fs-extra';
|
import * as fs from 'fs-extra';
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
import { IEnvironment } from '../types/environment';
|
import { IEnvironment } from '../types/environment';
|
||||||
import { IProcessData, spawnProcess } from '../util/run';
|
import { spawnProcess } from '../util/run';
|
||||||
|
|
||||||
export class NPMExecutor {
|
export class NPMExecutor {
|
||||||
private installed: string[] = [];
|
private installed: string[] = [];
|
||||||
@ -41,8 +41,13 @@ export class NPMExecutor {
|
|||||||
await this.init();
|
await this.init();
|
||||||
}
|
}
|
||||||
|
|
||||||
const pkgNoVersion = pkg.split('@')[0];
|
let spi = 0;
|
||||||
if (this.installed.indexOf(pkgNoVersion) !== -1) {
|
if (pkg.indexOf('@') === 0) {
|
||||||
|
spi = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
const pkgNoVersion = pkg.split('@')[spi];
|
||||||
|
if (this.installed.indexOf((spi === 1 ? '@' : '') + pkgNoVersion) !== -1) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user