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