-
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add a button to restore the default plugin, which will also upd…
…ate the default plugin contents with new Thorium Nova versions.
- Loading branch information
1 parent
2c562b8
commit 82388a8
Showing
5 changed files
with
127 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import {promises as fs} from "fs"; | ||
import path from "path"; | ||
import {rootPath, thoriumPath} from "@server/utils/appPaths"; | ||
import {unzip} from "@server/utils/unzipFolder"; | ||
|
||
const isHeadless = !process.env.FORK; | ||
|
||
export async function initDefaultPlugin() { | ||
await fs.mkdir(thoriumPath, {recursive: true}); | ||
await fs.mkdir(path.join(thoriumPath, "plugins"), {recursive: true}); | ||
|
||
// Initialize the default plugin | ||
await unzip( | ||
path.join(rootPath, isHeadless ? "./" : "../../app", "defaultPlugin.zip"), | ||
path.join(thoriumPath, "plugins/") | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters