Skip to content

Commit

Permalink
Merge pull request #14 from WorriedArrow/develop
Browse files Browse the repository at this point in the history
Merge 0.2.0 from nightly to stable
  • Loading branch information
WorriedArrow authored Jan 15, 2023
2 parents 13fcdc4 + d13432e commit f81fbf6
Show file tree
Hide file tree
Showing 33 changed files with 4,595 additions and 569 deletions.
13 changes: 11 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -107,5 +107,14 @@ dist
setup.cmd

# e
e.html
e2.html
/e.html
/e2.html

# Old version of the code
/openloader.js

# Installer
/installer/

# App to package
/index.js
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ $ ./openloader-linux canary
```
would install OpenLoader to Discord Canary.

(all options [here](https://github.com/WorriedArrow/OpenLoader/blob/develop/index.js#L8-L13))

## Building
### Prerequisites
- [NodeJS](https://nodejs.org) and [NPM](https://npmjs.org)
Expand All @@ -55,7 +57,7 @@ $ npm install
```
Then, simply run:
```
$ pkg .
$ npm run build
```
Then, the executables should be in `/dist`. Run your platform's executable to test your code out!

Expand Down
1 change: 1 addition & 0 deletions dev.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
require("./scripts/dev")();
33 changes: 13 additions & 20 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
const { readFileSync, writeFileSync, existsSync } = require("fs");
const { homedir, platform } = require("os");
const { join } = require("path");
const terser = require("terser");

let channel = "";

Expand All @@ -27,23 +26,17 @@ if(!existsSync(settingsJson)) {
console.log("Error: No settings.json found. Please check that the client you selected is installed.");
process.exit(1);
}

let data = JSON.parse(readFileSync(settingsJson).toString());
console.time("minify");
terser.minify(readFileSync(join(__dirname, "openloader.js")).toString(), {
keep_classnames: true,
keep_fnames: true,
}).then(minified => {
minified = minified.code;
console.timeEnd("minify");
if(!data.openasar) {
console.log("Error: No OpenAsar found in your settings.json. Please install OpenAsar (https://openasar.dev) before attempting to install OpenLoader.");
process.exit(1);
}
data.openasar.js = minified;
writeFileSync(settingsJson, JSON.stringify(data, undefined, "\t"));
console.log("Done! You can now restart your Discord client.\nFully restart it by right clicking it in the system tray and clicking Quit.\n\n\nPress any key to exit the installer...");
process.stdin.resume();
process.stdin.setEncoding('utf-8');
process.stdin.setRawMode(true);
process.stdin.on('data', () => process.exit(0));
});
var minified = readFileSync(join(__dirname, "dist", "openloader.min.js")).toString();
if(!data.openasar) {
console.log("Error: No OpenAsar found in your settings.json. Please install OpenAsar (https://openasar.dev) before attempting to install OpenLoader.");
process.exit(1);
}
data.openasar.js = minified;
writeFileSync(settingsJson, JSON.stringify(data, undefined, "\t"));
console.log("Done! You can now restart your Discord client.\nFully restart it by right clicking it in the system tray and clicking Quit.\n\n\nPress any key to exit the installer...");
process.stdin.resume();
process.stdin.setEncoding('utf-8');
process.stdin.setRawMode(true);
process.stdin.on('data', () => process.exit(0));
1 change: 1 addition & 0 deletions makeInstaller.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
require("./scripts/installer/makeInstaller")();
420 changes: 0 additions & 420 deletions openloader.js

This file was deleted.

Loading

0 comments on commit f81fbf6

Please sign in to comment.