Fix various bugs and toolchain
- Fix an issue where dist might not have the proper package.json - Fix an issue with PublicServers adding button to guild list - Fix the placement of BD in settings - Change default modal button to `primary` - Change restart prompts to have `danger` prop - Change tooltips to use `primary` rather than `black` - Remove VoiceMode - Remove DarkMode - Give a hover effect to the public servers button - Fix expanding icon in emote menu - Fix over-bolded text in setting descriptions
This commit is contained in:
parent
74b2dace04
commit
847ef94c25
|
@ -32,10 +32,6 @@
|
|||
},
|
||||
"appearance": {
|
||||
"name": "Aussehen",
|
||||
"voiceMode": {
|
||||
"name": "Sprachmodus",
|
||||
"note": "Verbirgt alles, was kein Sprachkanal ist."
|
||||
},
|
||||
"twentyFourHour": {
|
||||
"name": "24h Zeitstempel",
|
||||
"note": "Zeigt die Zeitstempel in einem 24h format an."
|
||||
|
@ -44,10 +40,6 @@
|
|||
"name": "Minimaler Modus",
|
||||
"note": "Verbirgt Elemente und reduziert die Größe von elementen."
|
||||
},
|
||||
"darkMode": {
|
||||
"name": "Dunkelmodus",
|
||||
"note": "Aktivert einen noch dunkleren Modus in Discord."
|
||||
},
|
||||
"coloredText": {
|
||||
"name": "Farbiger Text",
|
||||
"note": "Macht die Textfarbe gleich mit der Rollenfarbe."
|
||||
|
|
|
@ -32,10 +32,6 @@
|
|||
},
|
||||
"appearance": {
|
||||
"name": "Appearance",
|
||||
"voiceMode": {
|
||||
"name": "Voice Mode",
|
||||
"note": "Hides everything that isn't voice chat"
|
||||
},
|
||||
"minimalMode": {
|
||||
"name": "Minimal Mode",
|
||||
"note": "Hide elements and reduce the size of elements"
|
||||
|
@ -44,10 +40,6 @@
|
|||
"name": "24-Hour Timestamps",
|
||||
"note": "Converts 12-hour timestamps to 24-hour format"
|
||||
},
|
||||
"darkMode": {
|
||||
"name": "Dark Mode",
|
||||
"note": "Make certain elements dark by default"
|
||||
},
|
||||
"coloredText": {
|
||||
"name": "Colored Text",
|
||||
"note": "Make text colour the same as role color"
|
||||
|
|
|
@ -32,10 +32,6 @@
|
|||
},
|
||||
"appearance": {
|
||||
"name": "外観",
|
||||
"voiceMode": {
|
||||
"name": "ボイスモード",
|
||||
"note": "ボイスチャンネル以外を表示しないようにします"
|
||||
},
|
||||
"twentyFourHour": {
|
||||
"name": "24時間表記",
|
||||
"note": "時間を24時間表記に変更します。"
|
||||
|
@ -44,10 +40,6 @@
|
|||
"name": "コンパクトモード",
|
||||
"note": "表示をコンパクトにします。"
|
||||
},
|
||||
"darkMode": {
|
||||
"name": "ダークモード",
|
||||
"note": "ダークモードを有効にします"
|
||||
},
|
||||
"coloredText": {
|
||||
"name": "カラーテキスト",
|
||||
"note": "テキストカラーをサーバルールの色と同じにします。"
|
||||
|
|
|
@ -32,10 +32,6 @@
|
|||
},
|
||||
"appearance": {
|
||||
"name": "Utseende",
|
||||
"voiceMode": {
|
||||
"name": "Röstläge",
|
||||
"note": "Gömmer allt förutom röstchatt"
|
||||
},
|
||||
"twentyFourHour": {
|
||||
"name": "24-Timmars Tidsstämpel",
|
||||
"note": "Visar 24-timmars tidsstämplar istället för AM/PM"
|
||||
|
@ -44,10 +40,6 @@
|
|||
"name": "Minimalt Läge",
|
||||
"note": "Gömmer och förminskar komponenter"
|
||||
},
|
||||
"darkMode": {
|
||||
"name": "Mörkt Läge",
|
||||
"note": "Gör vissa komponenter mörka"
|
||||
},
|
||||
"coloredText": {
|
||||
"name": "Färgad Text",
|
||||
"note": "Gör att text får samma färg som rollfärgen"
|
||||
|
|
|
@ -1,15 +0,0 @@
|
|||
import Builtin from "../../structs/builtin";
|
||||
|
||||
export default new class DarkMode extends Builtin {
|
||||
get name() {return "DarkMode";}
|
||||
get category() {return "appearance";}
|
||||
get id() {return "darkMode";}
|
||||
|
||||
enabled() {
|
||||
document.getElementById("app-mount").classList.add("bda-dark", "bd-dark");
|
||||
}
|
||||
|
||||
disabled() {
|
||||
document.getElementById("app-mount").classList.remove("bda-dark", "bd-dark");
|
||||
}
|
||||
};
|
|
@ -1,19 +0,0 @@
|
|||
import Builtin from "../../structs/builtin";
|
||||
|
||||
export default new class VoiceMode extends Builtin {
|
||||
get name() {return "VoiceMode";}
|
||||
get category() {return "appearance";}
|
||||
get id() {return "voiceMode";}
|
||||
|
||||
enabled() {
|
||||
document.querySelector(".chat-3bRxxu").style.setProperty("visibility", "hidden");
|
||||
document.querySelector(".chat-3bRxxu").style.setProperty("min-width", "0px");
|
||||
document.querySelector(".channels-Ie2l6A").style.setProperty("flex-grow", "100000");
|
||||
}
|
||||
|
||||
disabled() {
|
||||
document.querySelector(".chat-3bRxxu").style.setProperty("visibility", "");
|
||||
document.querySelector(".chat-3bRxxu").style.setProperty("min-width", "");
|
||||
document.querySelector(".channels-Ie2l6A").style.setProperty("flex-grow", "");
|
||||
}
|
||||
};
|
|
@ -9,11 +9,9 @@ export {default as VoiceDisconnect} from "./general/voicedisconnect";
|
|||
|
||||
export {default as TwentyFourHour} from "./appearance/24hour";
|
||||
export {default as ColoredText} from "./appearance/coloredtext";
|
||||
export {default as DarkMode} from "./appearance/darkmode";
|
||||
export {default as HideGIFButton} from "./appearance/hidegifbutton";
|
||||
export {default as HideGiftButton} from "./appearance/hidegiftbutton";
|
||||
export {default as MinimalMode} from "./appearance/minimalmode";
|
||||
export {default as VoiceMode} from "./appearance/voicemode";
|
||||
|
||||
export {default as EmoteModule} from "./emotes/emotes";
|
||||
export {default as EmoteMenu} from "./emotes/emotemenu";
|
||||
|
|
|
@ -23,6 +23,7 @@ export default new class ReactDevTools extends Builtin {
|
|||
Modals.showConfirmationModal(Strings.Modals.additionalInfo, Strings.Modals.restartPrompt, {
|
||||
confirmText: Strings.Modals.restartNow,
|
||||
cancelText: Strings.Modals.restartLater,
|
||||
danger: true,
|
||||
onConfirm: () => IPC.relaunch()
|
||||
});
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@ export default new class PublicServers extends Builtin {
|
|||
|
||||
_appendButton() {
|
||||
const wrapper = DiscordModules.GuildClasses.wrapper.split(" ")[0];
|
||||
const guilds = DOM.query(`.${wrapper} .scroller-2TZvBN >:first-child`);
|
||||
const guilds = DOM.query(`.${wrapper} .listItem-2P_4kh`);
|
||||
DOM.after(guilds, this.button);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import Builtin from "../../structs/builtin";
|
||||
import {DiscordModules} from "modules";
|
||||
|
||||
export default new class DarkMode extends Builtin {
|
||||
export default new class VoiceDisconnect extends Builtin {
|
||||
get name() {return "VoiceDisconnect";}
|
||||
get category() {return "general";}
|
||||
get id() {return "voiceDisconnect";}
|
||||
|
|
|
@ -20,6 +20,7 @@ export default new class WindowPrefs extends Builtin {
|
|||
Modals.showConfirmationModal(Strings.Modals.additionalInfo, info, {
|
||||
confirmText: Strings.Modals.restartNow,
|
||||
cancelText: Strings.Modals.restartLater,
|
||||
danger: true,
|
||||
onConfirm: () => IPC.relaunch()
|
||||
});
|
||||
}
|
||||
|
|
|
@ -19,9 +19,7 @@ export default [
|
|||
{type: "switch", id: "twentyFourHour", value: false},
|
||||
{type: "switch", id: "hideGiftButton", value: false},
|
||||
{type: "switch", id: "hideGIFButton", value: false},
|
||||
{type: "switch", id: "voiceMode", value: false},
|
||||
{type: "switch", id: "minimalMode", value: false},
|
||||
{type: "switch", id: "darkMode", value: false},
|
||||
{type: "switch", id: "coloredText", value: false}
|
||||
]
|
||||
},
|
||||
|
|
|
@ -32,10 +32,6 @@ export default {
|
|||
},
|
||||
appearance: {
|
||||
name: "Appearance",
|
||||
voiceMode: {
|
||||
name: "Voice Mode",
|
||||
note: "Hides everything that isn't voice chat"
|
||||
},
|
||||
minimalMode: {
|
||||
name: "Minimal Mode",
|
||||
note: "Hide elements and reduce the size of elements"
|
||||
|
@ -44,10 +40,6 @@ export default {
|
|||
name: "24-Hour Timestamps",
|
||||
note: "Converts 12-hour timestamps to 24-hour format"
|
||||
},
|
||||
darkMode: {
|
||||
name: "Dark Mode",
|
||||
note: "Make certain elements dark by default"
|
||||
},
|
||||
coloredText: {
|
||||
name: "Colored Text",
|
||||
note: "Make text colour the same as role color"
|
||||
|
|
|
@ -123,7 +123,7 @@ export default new class ComponentPatcher {
|
|||
if (!children || !author || !author.id || author.id !== "249746236008169473") return;
|
||||
if (!Array.isArray(children)) return;
|
||||
children.push(
|
||||
React.createElement(Tooltip, {color: "black", position: "top", text: "BetterDiscord Developer"},
|
||||
React.createElement(Tooltip, {color: "primary", position: "top", text: "BetterDiscord Developer"},
|
||||
props => React.createElement(Anchor, Object.assign({className: "bd-chat-badge", href: "https://github.com/rauenzi/BetterDiscordApp", title: "BetterDiscord", target: "_blank"}, props),
|
||||
React.createElement(BDLogo, {size: "16px", className: "bd-logo"})
|
||||
)
|
||||
|
@ -143,7 +143,7 @@ export default new class ComponentPatcher {
|
|||
if (!children || !user || !user.id || user.id !== "249746236008169473") return;
|
||||
if (!Array.isArray(children)) return;
|
||||
children.push(
|
||||
React.createElement(Tooltip, {color: "black", position: "top", text: "BetterDiscord Developer"},
|
||||
React.createElement(Tooltip, {color: "primary", position: "top", text: "BetterDiscord Developer"},
|
||||
props => React.createElement(Anchor, Object.assign({className: "bd-member-badge", href: "https://github.com/rauenzi/BetterDiscordApp", title: "BetterDiscord", target: "_blank"}, props),
|
||||
React.createElement(BDLogo, {size: "16px", className: "bd-logo"})
|
||||
)
|
||||
|
|
|
@ -66,7 +66,7 @@ export default new class DataStore {
|
|||
const oldSettings = channelData.settings;
|
||||
const newSettings = {
|
||||
general: {publicServers: oldSettings["bda-gs-1"], voiceDisconnect: oldSettings["bda-dc-0"], classNormalizer: oldSettings["fork-ps-4"], showToasts: oldSettings["fork-ps-2"]},
|
||||
appearance: {twentyFourHour: oldSettings["bda-gs-6"], voiceMode: oldSettings["bda-gs-4"], minimalMode: oldSettings["bda-gs-2"], darkMode: oldSettings["bda-gs-5"], coloredText: oldSettings["bda-gs-7"]},
|
||||
appearance: {twentyFourHour: oldSettings["bda-gs-6"], minimalMode: oldSettings["bda-gs-2"], coloredText: oldSettings["bda-gs-7"]},
|
||||
addons: {addonErrors: oldSettings["fork-ps-1"], autoReload: oldSettings["fork-ps-5"]},
|
||||
developer: {debuggerHotkey: oldSettings["bda-gs-8"], copySelector: oldSettings["fork-dm-1"], reactDevTools: oldSettings.reactDevTools}
|
||||
};
|
||||
|
|
|
@ -58,7 +58,7 @@
|
|||
transition: transform 0.1s;
|
||||
}
|
||||
|
||||
.bd-emote-collapse-icon.expanded svg {
|
||||
.bd-emote-collapse-icon.collapsed svg {
|
||||
transform: rotate(-90deg);
|
||||
}
|
||||
|
||||
|
|
|
@ -18,13 +18,19 @@
|
|||
}
|
||||
|
||||
#bd-pub-button {
|
||||
border-radius: 3px;
|
||||
background-color: var(--background-secondary);
|
||||
color: var(--interactive-normal);
|
||||
border-radius: 4px;
|
||||
background-color: var(--background-primary);
|
||||
color: var(--text-normal);
|
||||
text-align: center;
|
||||
font-size: 12px;
|
||||
line-height: 24px;
|
||||
height: 24px;
|
||||
transition: background-color 0.15s ease-out, color 0.15s ease-out;
|
||||
}
|
||||
|
||||
#bd-pub-button:hover {
|
||||
color: #fff;
|
||||
background-color: #3e82e5;
|
||||
}
|
||||
|
||||
#bd-connection {
|
||||
|
|
|
@ -203,7 +203,7 @@
|
|||
margin-top: 4px;
|
||||
font-size: 14px;
|
||||
line-height: 20px;
|
||||
font-weight: 500;
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
.bd-setting-divider {
|
||||
|
|
|
@ -77,7 +77,7 @@ export default class CodeEditor extends React.Component {
|
|||
}
|
||||
|
||||
makeButton(button) {
|
||||
return <Tooltip color="black" position="top" text={button.tooltip}>
|
||||
return <Tooltip color="primary" position="top" text={button.tooltip}>
|
||||
{props => {
|
||||
return <button {...props} className="btn btn-primary" onClick={(event) => {button.onClick(event, this.value);}}>{button.label}</button>;
|
||||
}}
|
||||
|
|
|
@ -53,7 +53,7 @@ export default class BDEmote extends React.Component {
|
|||
|
||||
render() {
|
||||
return React.createElement(TooltipWrapper, {
|
||||
color: "black",
|
||||
color: "primary",
|
||||
position: "top",
|
||||
text: this.label,
|
||||
delay: 750
|
||||
|
|
|
@ -85,7 +85,7 @@ export default class Modals {
|
|||
return ModalActions.openModal(props => {
|
||||
return React.createElement(ConfirmationModal, Object.assign({
|
||||
header: title,
|
||||
confirmButtonColor: danger ? this.Buttons.ButtonColors.RED : this.Buttons.ButtonColors.PRIMARY,
|
||||
confirmButtonColor: danger ? this.Buttons.ButtonColors.RED : this.Buttons.ButtonColors.BRAND,
|
||||
confirmText: confirmText,
|
||||
cancelText: cancelText,
|
||||
onConfirm: onConfirm,
|
||||
|
|
|
@ -66,7 +66,7 @@ export default new class SettingsRenderer {
|
|||
thisObject._reactInternalFiber.return.return.return.return.return.return.return.memoizedProps.id = "user-settings";
|
||||
});
|
||||
Patcher.after("SettingsManager", UserSettings.prototype, "generateSections", (thisObject, args, returnValue) => {
|
||||
let location = returnValue.findIndex(s => s.section.toLowerCase() == "linux") + 1;
|
||||
let location = returnValue.findIndex(s => s.section.toLowerCase() == "changelog") - 1;
|
||||
const insert = (section) => {
|
||||
returnValue.splice(location, 0, section);
|
||||
location++;
|
||||
|
|
|
@ -143,7 +143,7 @@ export default class AddonCard extends React.Component {
|
|||
}
|
||||
|
||||
makeButton(title, children, action) {
|
||||
return <Tooltip color="black" position="top" text={title}>
|
||||
return <Tooltip color="primary" position="top" text={title}>
|
||||
{(props) => {
|
||||
return <div {...props} className="bd-addon-button" onClick={action}>{children}</div>;
|
||||
}}
|
||||
|
@ -151,7 +151,7 @@ export default class AddonCard extends React.Component {
|
|||
}
|
||||
|
||||
makeControlButton(title, children, action, {danger = false, disabled = false} = {}) {
|
||||
return <Tooltip color="black" position="top" text={title}>
|
||||
return <Tooltip color="primary" position="top" text={title}>
|
||||
{(props) => {
|
||||
return <button {...props} className={"bd-button bd-addon-button" + (danger ? " bd-button-danger" : "") + (disabled ? " bd-button-disabled" : "")} onClick={action}>{children}</button>;
|
||||
}}
|
||||
|
|
|
@ -115,7 +115,7 @@ export default class AddonList extends React.Component {
|
|||
}
|
||||
|
||||
makeControlButton(title, children, action, selected = false) {
|
||||
return <Tooltip color="black" position="top" text={title}>
|
||||
return <Tooltip color="primary" position="top" text={title}>
|
||||
{(props) => {
|
||||
return <button {...props} className={"bd-button bd-view-button" + (selected ? " selected" : "")} onClick={action}>{children}</button>;
|
||||
}}
|
||||
|
|
|
@ -10,7 +10,7 @@ export default class SettingsTitle extends React.Component {
|
|||
render() {
|
||||
return <div className="bd-sidebar-header">
|
||||
<SidebarComponents.Header>BetterDiscord</SidebarComponents.Header>
|
||||
<Tooltip color="black" position="top" text="Changelog">
|
||||
<Tooltip color="primary" position="top" text="Changelog">
|
||||
{props =>
|
||||
<div {...props} className="bd-changelog-button" onClick={() => Modals.showChangelogModal(Changelog)}>
|
||||
<HistoryIcon className="bd-icon" size="16px" />
|
||||
|
|
|
@ -2,11 +2,13 @@ const args = process.argv;
|
|||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
|
||||
const doSanityChecks = require("./validate");
|
||||
const buildPackage = require("./package");
|
||||
|
||||
const useBdRelease = args[2] && args[2].toLowerCase() === "release";
|
||||
const releaseInput = useBdRelease ? args[3] && args[3].toLowerCase() : args[2] && args[2].toLowerCase();
|
||||
const release = releaseInput === "canary" ? "Discord Canary" : releaseInput === "ptb" ? "Discord PTB" : "Discord";
|
||||
console.log(`Injecting into version ${release}`);
|
||||
|
||||
const bdPath = useBdRelease ? path.resolve(__dirname, "..", "dist", "betterdiscord.asar") : path.resolve(__dirname, "..", "dist");
|
||||
const discordPath = (function() {
|
||||
if (process.platform === "win32") {
|
||||
const basedir = path.join(process.env.LOCALAPPDATA, release.replace(/ /g, ""));
|
||||
|
@ -27,8 +29,13 @@ const discordPath = (function() {
|
|||
}
|
||||
})();
|
||||
|
||||
doSanityChecks(bdPath);
|
||||
buildPackage(bdPath);
|
||||
console.log("");
|
||||
|
||||
console.log(`Injecting into ${release}`);
|
||||
if (!fs.existsSync(discordPath)) throw new Error(`Cannot find directory for ${release}`);
|
||||
console.log(`Found ${release} in ${discordPath}`);
|
||||
console.log(` ✅ Found ${release} in ${discordPath}`);
|
||||
|
||||
const appPath = path.join(discordPath, "app");
|
||||
const packageJson = path.join(appPath, "package.json");
|
||||
|
@ -38,15 +45,13 @@ if (!fs.existsSync(appPath)) fs.mkdirSync(appPath);
|
|||
if (fs.existsSync(packageJson)) fs.unlinkSync(packageJson);
|
||||
if (fs.existsSync(indexJs)) fs.unlinkSync(indexJs);
|
||||
|
||||
const bdPath = useBdRelease ? path.resolve(__dirname, "..", "dist", "betterdiscord.asar") : path.resolve(__dirname, "..", "dist");
|
||||
|
||||
console.log(`Writing package.json`);
|
||||
fs.writeFileSync(packageJson, JSON.stringify({
|
||||
name: "betterdiscord",
|
||||
main: "index.js",
|
||||
}, null, 4));
|
||||
console.log(" ✅ Wrote package.json");
|
||||
|
||||
console.log(`Writing index.js`);
|
||||
fs.writeFileSync(indexJs, `require("${bdPath.replace(/\\/g, "\\\\").replace(/"/g, "\\\"")}");`);
|
||||
|
||||
console.log(" ✅ Wrote index.js");
|
||||
console.log("");
|
||||
console.log(`Injection successful, please restart ${release}.`);
|
||||
|
|
|
@ -2,45 +2,22 @@ const fs = require("fs");
|
|||
const path = require("path");
|
||||
const asar = require("asar");
|
||||
|
||||
const doSanityChecks = require("./validate");
|
||||
const buildPackage = require("./package");
|
||||
|
||||
const dist = path.join(__dirname, "..", "dist");
|
||||
const bundleFile = path.join(dist, "betterdiscord.asar");
|
||||
|
||||
const doSanityChecks = function() {
|
||||
console.log("Ensuring build validity");
|
||||
const files = [
|
||||
path.join(dist, "injector.js"),
|
||||
path.join(dist, "preload.js"),
|
||||
path.join(dist, "renderer.js")
|
||||
];
|
||||
|
||||
for (const file of files) {
|
||||
const exists = fs.existsSync(file);
|
||||
if (!exists) throw new Error(` ❌ File missing: ${file}`);
|
||||
console.log(` ✅ Found ${file}`);
|
||||
}
|
||||
};
|
||||
|
||||
const cleanOldAsar = function() {
|
||||
console.log("");
|
||||
console.log("Ensuring clean build");
|
||||
if (!fs.existsSync(bundleFile)) return console.log(" ✅ Nothing to clean up");
|
||||
fs.unlinkSync(bundleFile);
|
||||
console.log(` ✅ Removed old bundle ${bundleFile}`);
|
||||
};
|
||||
|
||||
const buildPackage = function() {
|
||||
console.log("Ensuring valid package.json");
|
||||
|
||||
const pkgFile = path.join(dist, "package.json");
|
||||
if (fs.existsSync(pkgFile)) {
|
||||
const currentPkg = require(pkgFile);
|
||||
if (currentPkg.name && currentPkg.main && currentPkg.main === "injector.js") return console.log(" ✅ Existing package.json is valid");
|
||||
console.log(" ⚠️ Existing package.json is invalid");
|
||||
}
|
||||
fs.writeFileSync(pkgFile, JSON.stringify({name: "betterdiscord", main: "injector.js"}));
|
||||
console.log(" ✅ Created new package.json");
|
||||
};
|
||||
|
||||
const makeBundle = function() {
|
||||
console.log("");
|
||||
console.log("Generating bundle");
|
||||
asar.createPackage(dist, bundleFile).then(() => {
|
||||
console.log(` ✅ Successfully created bundle ${bundleFile}`);
|
||||
|
@ -49,14 +26,7 @@ const makeBundle = function() {
|
|||
});
|
||||
};
|
||||
|
||||
console.log("");
|
||||
doSanityChecks();
|
||||
|
||||
console.log("");
|
||||
doSanityChecks(dist);
|
||||
buildPackage(dist);
|
||||
cleanOldAsar();
|
||||
|
||||
console.log("");
|
||||
buildPackage();
|
||||
|
||||
console.log("");
|
||||
makeBundle();
|
|
@ -0,0 +1,16 @@
|
|||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
|
||||
module.exports = function(dist) {
|
||||
console.log("");
|
||||
console.log("Ensuring valid package.json");
|
||||
|
||||
const pkgFile = path.join(dist, "package.json");
|
||||
if (fs.existsSync(pkgFile)) {
|
||||
const currentPkg = require(pkgFile);
|
||||
if (currentPkg.name && currentPkg.main && currentPkg.main === "injector.js") return console.log(" ✅ Existing package.json is valid");
|
||||
console.log(" ⚠️ Existing package.json is invalid");
|
||||
}
|
||||
fs.writeFileSync(pkgFile, JSON.stringify({name: "betterdiscord", main: "injector.js"}));
|
||||
console.log(" ✅ Created new package.json");
|
||||
};
|
|
@ -0,0 +1,18 @@
|
|||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
|
||||
module.exports = function(dist) {
|
||||
console.log("");
|
||||
console.log("Ensuring build validity");
|
||||
const files = [
|
||||
path.join(dist, "injector.js"),
|
||||
path.join(dist, "preload.js"),
|
||||
path.join(dist, "renderer.js")
|
||||
];
|
||||
|
||||
for (const file of files) {
|
||||
const exists = fs.existsSync(file);
|
||||
if (!exists) throw new Error(` ❌ File missing: ${file}`);
|
||||
console.log(` ✅ Found ${file}`);
|
||||
}
|
||||
};
|
Loading…
Reference in New Issue