-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathfoundry-path.js
More file actions
34 lines (29 loc) · 842 Bytes
/
Copy pathfoundry-path.js
File metadata and controls
34 lines (29 loc) · 842 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/* eslint-disable */
import path from "path";
import fs from "fs-extra";
export default function foundryConfig()
{
const configPath = path.resolve(process.cwd(), "foundryconfig.json");
const manifestPath = path.resolve(process.cwd(), "module.json");
let version;
let config;
if (fs.existsSync(configPath))
{
config = fs.readJSONSync(configPath);
}
if (fs.existsSync(manifestPath))
{
version = fs.readJSONSync(manifestPath).compatibility.verified;
}
let foundryPath;
if (process.env.NODE_ENV == "production")
{
foundryPath = "./build";
}
else if (config?.path)
{
foundryPath = path.join(config.path, "modules", "warhammer-lib").replace("{version}", version);
}
console.log("Foundry Path: " + foundryPath);
return foundryPath;
}