save package version in config file

This commit is contained in:
pablof7z 2023-07-06 22:58:38 +02:00
commit 88811fbcd2
5 changed files with 9 additions and 2 deletions

View file

@ -10,9 +10,11 @@ COPY tsconfig.json .
RUN apt-get update -y && apt-get install -y openssl
RUN npx prisma generate
RUN npm run build
RUN npx prisma generate
RUN npm i
RUN npx prisma migrate deploy
ENTRYPOINT [ "node", "dist/index.js" ]

View file

@ -1,6 +1,6 @@
{
"name": "nsecbunkerd",
"version": "0.7.2",
"version": "0.7.3",
"description": "nsecbunker daemon",
"main": "dist/index.js",
"bin": {

View file

@ -2,6 +2,8 @@ import { readFileSync, writeFileSync } from 'fs';
import { NDKPrivateKeySigner } from '@nostr-dev-kit/ndk';
import { IAdminOpts } from '../daemon/admin';
import { version } from '../package.json';
const generatedKey = NDKPrivateKeySigner.generate();
export interface IConfig {
@ -56,6 +58,7 @@ async function getCurrentConfig(config: string): Promise<IConfig> {
export function saveCurrentConfig(config: string, currentConfig: any) {
try {
currentConfig.version = version;
const configString = JSON.stringify(currentConfig, null, 2);
writeFileSync(config, configString);
} catch (err: any) {

1
src/package.json Symbolic link
View file

@ -0,0 +1 @@
../package.json

View file

@ -12,6 +12,7 @@
// "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */
"declaration": true, /* Generates corresponding '.d.ts' file. */
"sourceMap": true, /* Generates corresponding '.map' file. */
"resolveJsonModule": true,
// "outFile": "./", /* Concatenate and emit output to single file. */
"outDir": "dist", /* Redirect output structure to the directory. */
"rootDir": "src", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */