From 20f994fbb8dc76a41d9325a0cd0047013dabc654 Mon Sep 17 00:00:00 2001 From: Dominic Hock Date: Wed, 5 Apr 2023 17:10:08 +0200 Subject: [PATCH] fix: try fix template folder Signed-off-by: Dominic Hock --- Dockerfile | 4 ++-- main.ts | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index fa8a0c2..a2a461a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -26,7 +26,7 @@ ENV SPACE_DEFAULT_STATUS="" WORKDIR /usr/src/app COPY package*.json ./ -COPY templates/ ./templates/ +COPY templates /usr/src/app/templates # From builder get all js files COPY --from=builder /usr/src/app/*.js /usr/src/app/ @@ -34,4 +34,4 @@ COPY --from=builder /usr/src/app/node_modules /usr/src/app/node_modules EXPOSE 2652 -CMD [ "npm", "start" ] +CMD [ "npm", "start" ] \ No newline at end of file diff --git a/main.ts b/main.ts index 6346e40..7b8170f 100644 --- a/main.ts +++ b/main.ts @@ -21,7 +21,10 @@ const SPACE_PROJECT = process.env['SPACE_PROJECT'] || "" const SPACE_TOKEN = process.env['SPACE_TOKEN'] || "" const SPACE_DEFAULT_STATUS = process.env['SPACE_DEFAULT_STATUS'] || "" -const SPACE_ISSUE_TEMPLATE = fs.readFileSync('templates/issue.txt', 'utf8'); +let SPACE_ISSUE_TEMPLATE = "{{body}}\r" +if (fs.existsSync('templates/issue.txt')) { + SPACE_ISSUE_TEMPLATE = fs.readFileSync('templates/issue.txt', 'utf8') +} const server = Restify.createServer(); new ErrorHandler(server);