Skip to content

Commit 4224f48

Browse files
CLIS-75 Updates package version
1 parent 18d530c commit 4224f48

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

Diff for: package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "scanoss",
3-
"version": "0.8.5",
3+
"version": "0.8.6",
44
"description": "The SCANOSS JS package provides a simple, easy to consume module for interacting with SCANOSS APIs/Engine.",
55
"main": "build/main/index.js",
66
"typings": "build/main/index.d.ts",

Diff for: src/cli/commands/scan.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,13 @@ import {
4040
import {
4141
DecompressionManager
4242
} from '../../sdk/Decompress/DecompressionManager';
43+
import path from 'path';
4344

4445

4546
export async function scanHandler(rootPath: string, options: any): Promise<void> {
4647

47-
rootPath = rootPath.replace(/\/$/, ''); // Remove trailing slash if exists
48-
rootPath = rootPath.replace(/^\./, process.env.PWD); // Convert relative path to absolute path.
48+
rootPath = path.resolve(rootPath);
49+
4950
const pathIsFolder = await isFolder(rootPath);
5051
const projectName = getProjectNameFromPath(rootPath)
5152

@@ -76,7 +77,7 @@ export async function scanHandler(rootPath: string, options: any): Promise<void>
7677
const scanner = new Scanner(scannerCfg);
7778

7879
let scannerInput: ScannerInput = {fileList: []};
79-
scannerInput.folderRoot = rootPath + '/'; // This will remove the project root path from the results.
80+
scannerInput.folderRoot = rootPath + path.sep; // This will remove the project root path from the results.
8081
if(options.flags) scannerInput.engineFlags = options.flags;
8182

8283

Diff for: src/sdk/Utils/Utils.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ export class Utils {
2828
if (this.PackageJSON) break;
2929
}
3030
}
31-
return this.PackageJSON.version
31+
return this.PackageJSON?.version ? this.PackageJSON.version : ''
32+
3233
}
3334

3435

0 commit comments

Comments
 (0)