mirror of
https://github.com/NovaGM/ModuleBuilder.git
synced 2024-08-15 00:23:33 +00:00
Added support for Vercel.
This commit is contained in:
parent
e941662b9f
commit
d7be675cab
1 changed files with 10 additions and 2 deletions
12
src/index.js
12
src/index.js
|
@ -11,7 +11,15 @@ import { createHash } from 'crypto';
|
||||||
import { dirname } from 'path';
|
import { dirname } from 'path';
|
||||||
import { fileURLToPath } from 'url';
|
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));
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
||||||
|
|
||||||
|
@ -197,4 +205,4 @@ for (const parentRepo of ModuleRepos) {
|
||||||
|
|
||||||
writeFileSync(`${distDir}/modules.json`, JSON.stringify(oldTotalModulesJson));
|
writeFileSync(`${distDir}/modules.json`, JSON.stringify(oldTotalModulesJson));
|
||||||
|
|
||||||
copyFileSync(`${__dirname.replace('/src', '')}/_headers`, `${distDir}/_headers`);
|
copyFileSync(`${__dirname.replace('/src', '')}/_headers`, `${distDir}/_headers`);
|
||||||
|
|
Loading…
Reference in a new issue