mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-12 03:31:07 +01:00
Add setup script for development (#981)
This commit is contained in:
parent
505ee6d3cf
commit
e692f3814d
6 changed files with 82 additions and 16 deletions
27
tools/run-start.mjs
Normal file
27
tools/run-start.mjs
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
#!/usr/bin/env node
|
||||
import { spawn } from 'child_process';
|
||||
import fs from 'fs';
|
||||
|
||||
// Load .env file if it exists
|
||||
if (fs.existsSync('.env')) {
|
||||
const envFile = fs.readFileSync('.env', 'utf8');
|
||||
envFile.split('\n').forEach(line => {
|
||||
const [key, value] = line.split('=');
|
||||
if (key && value) {
|
||||
process.env[key] = value;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Set defaults if not in environment
|
||||
const foundryPath = process.env.FOUNDRY_MAIN_PATH || '../../../../FoundryDev/main.js';
|
||||
const dataPath = process.env.FOUNDRY_DATA_PATH || '../../../';
|
||||
|
||||
// Run the original command with proper environment
|
||||
const args = ['rollup -c --watch', `node "${foundryPath}" --dataPath="${dataPath}" --noupnp`, 'gulp'];
|
||||
|
||||
spawn('npx', ['concurrently', ...args.map(arg => `"${arg}"`)], {
|
||||
stdio: 'inherit',
|
||||
cwd: process.cwd(),
|
||||
shell: true
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue