Skip to content

Commit

Permalink
refactor: simplify read version from package.json
Browse files Browse the repository at this point in the history
  • Loading branch information
c100k committed Nov 10, 2024
1 parent 7196ab5 commit 32efbfc
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions spec/generate-swagger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ import { type ExtendedSpecConfig, generateSpec } from 'tsoa';
const basePath = join('/app');

const pkgJsonPath = join(basePath, 'package.json');
const pkgJsonBuff = await readFile(pkgJsonPath);
const pkgJson = pkgJsonBuff.toString();
const pkgJson = await readFile(pkgJsonPath, 'utf-8');
const { version }: { version: string } = JSON.parse(pkgJson);

const specBasePath = join(basePath, 'spec');
Expand Down

0 comments on commit 32efbfc

Please sign in to comment.