Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f4515e5f99 | |||
| 1a6325794a | |||
| 09d7ab3d0a | |||
| a420bb1b09 |
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@push.rocks/smartpnpm",
|
"name": "@push.rocks/smartpnpm",
|
||||||
"version": "1.0.4",
|
"version": "1.0.6",
|
||||||
"private": false,
|
"private": false,
|
||||||
"description": "use pnpm in your code",
|
"description": "use pnpm in your code",
|
||||||
"main": "dist_ts/index.js",
|
"main": "dist_ts/index.js",
|
||||||
|
|||||||
@@ -3,6 +3,6 @@
|
|||||||
*/
|
*/
|
||||||
export const commitinfo = {
|
export const commitinfo = {
|
||||||
name: '@push.rocks/smartpnpm',
|
name: '@push.rocks/smartpnpm',
|
||||||
version: '1.0.4',
|
version: '1.0.6',
|
||||||
description: 'use pnpm in your code'
|
description: 'use pnpm in your code'
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,15 @@
|
|||||||
import * as plugins from './smartpnpm.plugins.js';
|
import * as plugins from './smartpnpm.plugins.js';
|
||||||
|
|
||||||
|
export interface IPnpmLicenseResult {
|
||||||
|
"name": string;
|
||||||
|
"version": string;
|
||||||
|
"path": string;
|
||||||
|
"license": string;
|
||||||
|
"author": string;
|
||||||
|
"homepage": string;
|
||||||
|
"description": string;
|
||||||
|
}
|
||||||
|
|
||||||
export class SmartPnpm {
|
export class SmartPnpm {
|
||||||
public projectDir: string;
|
public projectDir: string;
|
||||||
|
|
||||||
@@ -14,16 +24,8 @@ export class SmartPnpm {
|
|||||||
async getDependencyLicenseJson() {
|
async getDependencyLicenseJson() {
|
||||||
try {
|
try {
|
||||||
// Get store directory
|
// Get store directory
|
||||||
const execResult = await this.smartshellInstance.execSilent('pnpm licenses list --json');
|
const execResult = await this.smartshellInstance.execSilent(`(cd ${this.projectDir} && pnpm licenses list --json)`);
|
||||||
const licenseJson: {[key: string]: Array<{
|
const licenseJson: {[key: string]: Array<IPnpmLicenseResult>} = JSON.parse(execResult.stdout);
|
||||||
"name": string;
|
|
||||||
"version": string;
|
|
||||||
"path": string;
|
|
||||||
"license": string;
|
|
||||||
"author": string;
|
|
||||||
"homepage": string;
|
|
||||||
"description": string;
|
|
||||||
}>} = JSON.parse(execResult.stdout);
|
|
||||||
return licenseJson;
|
return licenseJson;
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|||||||
Reference in New Issue
Block a user