Added support for Vercel.

This commit is contained in:
Keanu Timmermans 2021-03-01 20:32:30 +01:00
parent e941662b9f
commit d7be675cab
Signed by: keanucode
GPG Key ID: A7431C0D513CA93B
1 changed files with 10 additions and 2 deletions

View File

@ -11,7 +11,15 @@ import { createHash } from 'crypto';
import { dirname } from 'path';
import { fileURLToPath } from 'url';
import githubPAT from './gh_pat.js';
let file;
let githubPAT;
try {
file = JSON.parse(readFileSync('./gh_pat.json'));
githubPAT = file.token;
} catch (error) {
if (error.code !== 'ENOENT') throw error;
githubPAT = process.env.GHTOKEN;
}
const __dirname = dirname(fileURLToPath(import.meta.url));
@ -197,4 +205,4 @@ for (const parentRepo of ModuleRepos) {
writeFileSync(`${distDir}/modules.json`, JSON.stringify(oldTotalModulesJson));
copyFileSync(`${__dirname.replace('/src', '')}/_headers`, `${distDir}/_headers`);
copyFileSync(`${__dirname.replace('/src', '')}/_headers`, `${distDir}/_headers`);