Fix error on Windows (#9)
This commit is contained in:
parent
0300abe06e
commit
ae21d6d6cc
13
src/index.js
13
src/index.js
|
@ -1,10 +1,7 @@
|
||||||
import ModuleRepos from './modules/index.js';
|
import ModuleRepos from './modules/index.js';
|
||||||
import AutoTag from './autoTag.js';
|
import AutoTag from './autoTag.js';
|
||||||
<<<<<<< HEAD
|
|
||||||
import WebhookSend from './webhook.js';
|
import WebhookSend from './webhook.js';
|
||||||
=======
|
|
||||||
import ImageCDN from './imageCdn.js';
|
import ImageCDN from './imageCdn.js';
|
||||||
>>>>>>> 606a100 ([Feat] Local images building)
|
|
||||||
|
|
||||||
import Parcel from 'parcel-bundler';
|
import Parcel from 'parcel-bundler';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
|
@ -13,7 +10,7 @@ import glob from 'glob';
|
||||||
import { rmSync, mkdirSync, readFileSync, writeFileSync, copyFileSync, existsSync, rmdirSync } from 'fs';
|
import { rmSync, mkdirSync, readFileSync, writeFileSync, copyFileSync, existsSync, rmdirSync } from 'fs';
|
||||||
import { createHash } from 'crypto';
|
import { createHash } from 'crypto';
|
||||||
|
|
||||||
import { dirname } from 'path';
|
import { dirname, sep } from 'path';
|
||||||
import { fileURLToPath } from 'url';
|
import { fileURLToPath } from 'url';
|
||||||
|
|
||||||
let file;
|
let file;
|
||||||
|
@ -28,9 +25,9 @@ try {
|
||||||
|
|
||||||
const __dirname = dirname(fileURLToPath(import.meta.url));
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
||||||
|
|
||||||
const clonesDir = `${__dirname.replace('/src', '')}/clones`;
|
const clonesDir = `${__dirname.replace(`${sep}src`, '')}/clones`;
|
||||||
|
|
||||||
const distDir = `${__dirname.replace('/src', '')}/dist`;
|
const distDir = `${__dirname.replace(`${sep}src`, '')}/dist`;
|
||||||
global.distDir = distDir;
|
global.distDir = distDir;
|
||||||
|
|
||||||
const modulesDir = `${distDir}/module`;
|
const modulesDir = `${distDir}/module`;
|
||||||
|
@ -245,6 +242,10 @@ for (const parentRepo of ModuleRepos) {
|
||||||
|
|
||||||
writeFileSync(`${distDir}/modules.json`, JSON.stringify(oldTotalModulesJson));
|
writeFileSync(`${distDir}/modules.json`, JSON.stringify(oldTotalModulesJson));
|
||||||
|
|
||||||
|
<<<<<<< HEAD
|
||||||
copyFileSync(`${__dirname.replace('/src', '')}/_headers`, `${distDir}/_headers`);
|
copyFileSync(`${__dirname.replace('/src', '')}/_headers`, `${distDir}/_headers`);
|
||||||
|
|
||||||
WebhookSend();
|
WebhookSend();
|
||||||
|
=======
|
||||||
|
copyFileSync(`${__dirname.replace(`${sep}src`, '')}/_headers`, `${distDir}/_headers`);
|
||||||
|
>>>>>>> 66b474c (Fix error on Windows (#9))
|
||||||
|
|
Loading…
Reference in New Issue