Skip to content

Commit 4643aa0

Browse files
committed
Fix a bug
1 parent e6177e2 commit 4643aa0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

keygen-vapid.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
const fs = require('fs');
22
const os = require('os');
3+
const path = require('path');
34
const webpush = require('web-push');
45

56
const write = (str, filename, flags) => {
6-
const filePath = path.join(__dirname, `${filename}.ts`);
7+
const filePath = path.join(__dirname, `${filename}`);
78
const writer = fs.createWriteStream(filePath, { flags });
89
writer.write(str);
910
writer.end();
@@ -18,7 +19,6 @@ const write = (str, filename, flags) => {
1819
const pubKeyStr = `VAPID_PUB_KEY=${vapidKeys.publicKey}`;
1920
const prvKeyStr = `VAPID_PRI_KEY=${vapidKeys.privateKey}`;
2021

21-
const str = [pubKeyStr, prvKeyStr].join(os.EOL);
22-
23-
write(str, '.env', 'a');
22+
const keys = [pubKeyStr, prvKeyStr].join(os.EOL);
23+
write(keys, '.env', 'a');
2424
})();

0 commit comments

Comments
 (0)