Skip to content

Commit

Permalink
less filesystem access
Browse files Browse the repository at this point in the history
  • Loading branch information
steam0r committed Jul 1, 2024
1 parent 67793eb commit a4a9bee
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions shared/api/utils/shared_doc_util.js
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ export default class SharedDocUtil extends SharedUtil
{
if (!opNames) return;
let changed = false;
if (opNames.length > 0) this._log.info("removing", opNames.length, "ops from lookup table");
if (opNames.length > 0) this._log.info("removing", opNames.length, "ops from lookup table", opNames.join(","));
for (let i = 0; i < opNames.length; i++)
{
const opName = opNames[i];
Expand Down Expand Up @@ -446,7 +446,7 @@ export default class SharedDocUtil extends SharedUtil

docObj.attachmentFiles = this._opsUtil.getAttachmentFiles(opname) || [];

const jsonFilename = dirName + opname + ".json";
const jsonFilename = path.join(dirName, opname + ".json");
const jsonExists = fs.existsSync(jsonFilename);

const screenshotFilename = dirName + "screenshot.png";
Expand Down Expand Up @@ -601,7 +601,7 @@ export default class SharedDocUtil extends SharedUtil
this._log.warn("getExampleProjectId: no opDocs");
return null;
}
if (this._opsUtil.existingCoreOp(opname))
if (this._opsUtil.isCoreOp(opname))
{
for (const i in opDocs)
{
Expand Down
4 changes: 2 additions & 2 deletions shared/api/utils/shared_ops_util.js
Original file line number Diff line number Diff line change
Expand Up @@ -2108,7 +2108,7 @@ export default class SharedOpsUtil extends SharedUtil
p += sanitizeFileName(attName);
if (res) res.endTime("sanitizeFileName");

if (this.existingCoreOp(opName))
if (this.isCoreOp(opName))
{
if (p.endsWith(".js"))
{
Expand Down Expand Up @@ -2527,7 +2527,7 @@ export default class SharedOpsUtil extends SharedUtil
}

const formatedCode = format.formatedCode;
if (this.existingCoreOp(opName) || options.formatCode)
if (options.formatCode || this.isCoreOp(opName))
{
code = formatedCode;
}
Expand Down

0 comments on commit a4a9bee

Please sign in to comment.