Include manifest in release
This commit is contained in:
parent
8a53842736
commit
8d08a035d8
2
.github/workflows/release.yml
vendored
2
.github/workflows/release.yml
vendored
|
@ -33,5 +33,5 @@ jobs:
|
|||
|
||||
- uses: ncipollo/release-action@v1
|
||||
with:
|
||||
artifacts: "*.asar"
|
||||
artifacts: "bundle/*"
|
||||
makeLatest: true
|
||||
|
|
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -103,4 +103,4 @@ dist
|
|||
# TernJS port file
|
||||
.tern-port
|
||||
|
||||
/*.asar
|
||||
/bundle
|
||||
|
|
|
@ -1,8 +1,12 @@
|
|||
import asar from "@electron/asar";
|
||||
import { readFileSync } from "fs";
|
||||
import { copyFileSync, existsSync, mkdirSync, readFileSync } from "fs";
|
||||
import { PluginManifest } from "replugged/dist/types/addon";
|
||||
|
||||
const manifest = JSON.parse(readFileSync("manifest.json", "utf-8")) as PluginManifest;
|
||||
const outputName = `${manifest.id}.asar`;
|
||||
const manifest = JSON.parse(readFileSync("dist/manifest.json", "utf-8")) as PluginManifest;
|
||||
const outputName = `bundle/${manifest.id}`;
|
||||
|
||||
asar.createPackage("dist", outputName);
|
||||
if (!existsSync("bundle")) {
|
||||
mkdirSync("bundle");
|
||||
}
|
||||
asar.createPackage("dist", `${outputName}.asar`);
|
||||
copyFileSync("dist/manifest.json", `${outputName}.json`);
|
||||
|
|
Loading…
Reference in a new issue