mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
[CREATE RESOURCE]: removed fs.pathExists before reading template file content
Signed-off-by: Roman <ixrock@gmail.com>
This commit is contained in:
parent
21296d6d12
commit
9d534d4e0b
@ -102,15 +102,9 @@ export class CreateResourceStore extends DockTabStore<string> {
|
||||
|
||||
try {
|
||||
const templatePath = path.resolve(sourceFolder, filePath);
|
||||
const pathExists = await fs.pathExists(templatePath);
|
||||
|
||||
if (!pathExists) return ""; // template file not exists, skip
|
||||
|
||||
const textContent = await fs.readFile(templatePath, { encoding: "utf-8" });
|
||||
|
||||
templatesGroup.templates.set(filePath, textContent); // save cache
|
||||
|
||||
return textContent;
|
||||
} catch (error) {
|
||||
logger.error(`[CREATE-RESOURCE]: reading "${sourceFolder}/${filePath}" has failed: ${error}`);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user