Update server platforms to v2 paths #465
4
.github/dependabot.yml
vendored
4
.github/dependabot.yml
vendored
@@ -8,4 +8,6 @@ updates:
|
||||
- package-ecosystem: npm
|
||||
directory: /
|
||||
schedule:
|
||||
interval: daily
|
||||
interval: monthly
|
||||
assignees:
|
||||
- Sirherobrine23
|
||||
|
15
.github/workflows/test.yml
vendored
15
.github/workflows/test.yml
vendored
@@ -20,6 +20,8 @@ jobs:
|
||||
- Spigot
|
||||
runs-on: ubuntu-latest
|
||||
name: "${{ matrix.platform }}"
|
||||
env:
|
||||
BDS_HOME: "~/.bdsCore"
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
name: Code checkout
|
||||
@@ -50,4 +52,15 @@ jobs:
|
||||
|
||||
# Run test
|
||||
- name: Test
|
||||
run: npm run test:partial -- tests/${{ matrix.platform }}.ts
|
||||
run: npm run test:partial -- tests/${{ matrix.platform }}.ts
|
||||
|
||||
# Upload bds root
|
||||
- name: Upload BdsCore folder
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: ${{ matrix.platform }}
|
||||
path: |
|
||||
~/.bdsCore
|
||||
!~/.bdsCore/**/*.debug
|
||||
!~/.bdsCore/**/bedrock_server
|
||||
!~/.bdsCore/**/*_packs/
|
@@ -1,10 +0,0 @@
|
||||
import { installServer, startServer } from "../src/pocketmine";
|
||||
|
||||
(async function(){
|
||||
await installServer("latest");
|
||||
const serverManeger = await startServer();
|
||||
serverManeger.on("log", console.log);
|
||||
serverManeger.on("portListening", console.log);
|
||||
serverManeger.on("serverStarted", () => serverManeger.stopServer());
|
||||
return serverManeger.waitExit();
|
||||
})().catch(err => console.trace(err));
|
@@ -3,7 +3,11 @@ import path from "node:path";
|
||||
import fs from "node:fs/promises";
|
||||
import os from "node:os";
|
||||
|
||||
export const bdsRoot = process.env.BDS_HOME||path.join(os.homedir(), ".bdsManeger");
|
||||
export let bdsRoot = path.join(os.homedir(), ".bdsManeger");
|
||||
if (process.env.BDS_HOME) {
|
||||
if (process.env.BDS_HOME.startsWith("~")) process.env.BDS_HOME = process.env.BDS_HOME.replace("~", os.homedir());
|
||||
bdsRoot = process.env.BDS_HOME;
|
||||
}
|
||||
async function exists(filePath: string) {
|
||||
return fs.access(filePath).then(() => true).catch((() => false));
|
||||
}
|
||||
|
Reference in New Issue
Block a user