Skip to content

Commit

Permalink
fix: correctly read previous config file
Browse files Browse the repository at this point in the history
  • Loading branch information
tschoffelen committed Sep 7, 2024
1 parent 4ee2c7d commit 795eadf
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions packages/deploy-script/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import crypto from "crypto";
import inquirer from "inquirer";
import degit from "degit";
import child_process from "child_process";
import { mkdir, writeFile } from "fs/promises";
import { mkdir, writeFile, readFile } from "fs/promises";

import {
ApiGatewayV2Client,
Expand All @@ -16,10 +16,12 @@ import {
const tmpPath = "/tmp/trace-stack";
let previousConfig = {};
try {
previousConfig = require(`${tmpPath}/packages/lambda-layer/config.json`);
} catch (e) {
console.log(e);
}
const json = await readFile(
`${tmpPath}/packages/lambda-layer/config.json`,
"utf8",
);
previousConfig = JSON.parse(json);
} catch (e) {}

// TODO: use previous token if it exists
const tracerToken =
Expand Down

0 comments on commit 795eadf

Please sign in to comment.