feat: add Screeps console monitoring with configurable error handling and shard support (#84)
Reviewed-on: #84
This commit was merged in pull request #84.
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
import { glob } from "glob";
|
||||
import path from "path";
|
||||
import os from "os";
|
||||
import fs from "fs";
|
||||
|
||||
async function test() {
|
||||
const tempDir = await fs.promises.mkdtemp(
|
||||
path.join(os.tmpdir(), "glob-test-"),
|
||||
);
|
||||
const file = path.join(tempDir, "test.js");
|
||||
await fs.promises.writeFile(file, "test");
|
||||
|
||||
const pattern = "*.js";
|
||||
const globPattern = path.join(tempDir, pattern);
|
||||
console.log("globPattern:", globPattern);
|
||||
|
||||
const files = await glob(globPattern);
|
||||
console.log("found files:", files);
|
||||
|
||||
// Fix for windows
|
||||
const fixedPattern = globPattern.replace(/\\/g, "/");
|
||||
console.log("fixedPattern:", fixedPattern);
|
||||
const fixedFiles = await glob(fixedPattern);
|
||||
console.log("found fixed files:", fixedFiles);
|
||||
|
||||
await fs.promises.rm(tempDir, { recursive: true, force: true });
|
||||
}
|
||||
|
||||
test();
|
||||
Reference in New Issue
Block a user