Commit 70c14761 authored by LongLD's avatar LongLD

fix: update ROOT_DIR fallback to use package directory instead of current working directory

parent dd6e1776
......@@ -10,8 +10,10 @@ import { fileURLToPath } from 'url';
// --- Configuration ---
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
// Allow override via command line argument, environment variable, or use current working directory
const ROOT_DIR = process.argv[2] || process.env.AWING_RULES_ROOT || process.cwd();
// Package directory contains the rules (one level up from src)
const PACKAGE_DIR = path.resolve(__dirname, '..');
// Allow override via command line argument, environment variable, or use package rules as fallback
const ROOT_DIR = process.argv[2] || process.env.AWING_RULES_ROOT || PACKAGE_DIR;
// --- Initialization ---
const indexer = new RuleIndexer(ROOT_DIR);
const composer = new Composer(ROOT_DIR);
......
......@@ -17,8 +17,10 @@ import { fileURLToPath } from 'url';
// --- Configuration ---
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
// Allow override via command line argument, environment variable, or use current working directory
const ROOT_DIR = process.argv[2] || process.env.AWING_RULES_ROOT || process.cwd();
// Package directory contains the rules (one level up from src)
const PACKAGE_DIR = path.resolve(__dirname, '..');
// Allow override via command line argument, environment variable, or use package rules as fallback
const ROOT_DIR = process.argv[2] || process.env.AWING_RULES_ROOT || PACKAGE_DIR;
// --- Initialization ---
const indexer = new RuleIndexer(ROOT_DIR);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment