Skip to content

Commit

Permalink
fix runtime bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
ghackenberg committed May 2, 2024
1 parent aecba1e commit 099bd82
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
9 changes: 7 additions & 2 deletions packages/backend/scripts/src/functions/pack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ const materialsFileName = 'LDConfig.ldr'

const materialsFilePath = path.join(ldrawPath, materialsFileName)

console.log('Loading materials file "' + materialsFilePath + '"...')
const materialsContent = fs.readFileSync(materialsFilePath, { encoding: 'utf8' })
var materialsContent: string = null

export function packLDrawText(text: string) {
const fileName = `${shortid()}.ldr`
Expand Down Expand Up @@ -49,6 +48,12 @@ export function packLDrawFile(fileName: string) {
throw 'error'
}

// Loading materials content
if (!materialsContent) {
console.log('Loading materials file "' + materialsFilePath + '"...')
materialsContent = fs.readFileSync(materialsFilePath, { encoding: 'utf8' })
}

// Obtain packed content
let packedContent = materialsContent + '\n'
for (let i = objectsPaths.length - 1; i >= 0; i--) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export class CommentController implements CommentREST {
@ApiParam({ name: 'productId', type: 'string', required: true })
@ApiParam({ name: 'issueId', type: 'string', required: true })
@ApiBody({ type: CommentCreate, required: true })
@ApiResponse({ type: Comment })
@ApiResponse({ type: CommentRead })
async addComment(
@Param('productId') productId: string,
@Param('issueId') issueId: string,
Expand Down Expand Up @@ -67,7 +67,7 @@ export class CommentController implements CommentREST {
@ApiParam({ name: 'issueId', type: 'string', required: true })
@ApiParam({ name: 'commentId', type: 'string', required: true })
@ApiBody({ type: CommentUpdate, required: true })
@ApiResponse({ type: Comment })
@ApiResponse({ type: CommentRead })
async updateComment(
@Param('productId') productId: string,
@Param('issueId') issueId: string,
Expand Down

0 comments on commit 099bd82

Please sign in to comment.