@sap/adp-common
Advanced tools
Comparing version 1.1.42 to 1.1.43
@@ -5,4 +5,4 @@ import { WorkspaceFolder, AllAppResults, AppFolders } from "../models/Types"; | ||
static isWorkspaceFolder(value: WorkspaceFolder[] | string[]): value is WorkspaceFolder[]; | ||
static findAll(root: string, filename: string, stopFolders: string[]): Promise<string[]>; | ||
static findProject(wsRoot: string): Promise<string[]>; | ||
static findAll(root: string, filename: string, stopFolders: string[], files: string[]): Promise<void>; | ||
static findProject(wsRoot: string, files: string[]): Promise<void>; | ||
static findAllPackageJsonFolders(wsFolders: WsFolders): Promise<string[]>; | ||
@@ -9,0 +9,0 @@ static findAllManifest(wsFolders: WsFolders): Promise<string[]>; |
@@ -47,6 +47,5 @@ "use strict"; | ||
} | ||
static findAll(root, filename, stopFolders) { | ||
static findAll(root, filename, stopFolders, files) { | ||
return new Promise((doResolve, reject) => { | ||
const finder = findit(root); | ||
const results = []; | ||
finder.on("directory", (dir, stat, stop) => { | ||
@@ -60,7 +59,7 @@ const base = (0, path_1.basename)(dir); | ||
if (file.endsWith(filename)) { | ||
results.push((0, path_1.dirname)(file)); | ||
files.push((0, path_1.dirname)(file)); | ||
} | ||
}); | ||
finder.on("end", () => { | ||
doResolve(results); | ||
doResolve(); | ||
}); | ||
@@ -72,4 +71,6 @@ finder.on("error", (error) => { | ||
} | ||
static findProject(wsRoot) { | ||
return this.findAll(wsRoot, PACKAGE_JSON, [".git", "node_modules", "dist", "generator-adaptationproject-creation", WEB_APP_DIRECTORY]); | ||
static findProject(wsRoot, files) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
yield this.findAll(wsRoot, PACKAGE_JSON, [".git", "node_modules", "dist", "generator-adaptationproject-creation", WEB_APP_DIRECTORY], files); | ||
}); | ||
} | ||
@@ -90,5 +91,5 @@ static findAllPackageJsonFolders(wsFolders) { | ||
} | ||
let projects = []; | ||
const projects = []; | ||
for (const root of wsRoots) { | ||
projects = [...(yield this.findProject(root))]; | ||
yield this.findProject(root, projects); | ||
} | ||
@@ -112,5 +113,5 @@ return projects; | ||
} | ||
let manifests = []; | ||
const manifests = []; | ||
for (const root of wsRoots) { | ||
manifests = [...(yield this.findAll(root, "manifest.appdescr_variant", [".git", "node_modules", "generator-adaptationproject-creation", "dist"]))]; | ||
yield this.findAll(root, "manifest.appdescr_variant", [".git", "node_modules", "generator-adaptationproject-creation", "dist"], manifests); | ||
} | ||
@@ -197,8 +198,5 @@ return manifests; | ||
for (const root of roots) { | ||
if (root === path) { | ||
if (root === path || (path.startsWith(root) && path.replace(root, "").startsWith(path_1.sep))) { | ||
return root; | ||
} | ||
else if (path.startsWith(root) && path.replace(root, "").startsWith(path_1.sep)) { | ||
return root; | ||
} | ||
} | ||
@@ -205,0 +203,0 @@ return undefined; |
{ | ||
"name": "@sap/adp-common", | ||
"version": "1.1.42", | ||
"version": "1.1.43", | ||
"description": "common logic for all yeoman generators", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
141805
2187