Skip to content

Commit e267975

Browse files
committed
fix(commands): load from the canonical command directories
The default command loader used `.cortex/command` and `Cortex/command` (singular, capital-C), but the canonical directories used by manager.rs and import.rs are `.cortex/commands` and `cortex/commands` (plural, lowercase). On case-sensitive filesystems, commands imported/written to the canonical location were never found by the default loader. Align the defaults (and the doc comment) with the rest of the crate. Fixes #416
1 parent 7954d02 commit e267975

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

‎src/cortex-commands/src/loader.rs‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,17 +41,17 @@ impl CommandLoader {
4141
/// Create a new loader with default search paths.
4242
///
4343
/// Default paths:
44-
/// 1. `.cortex/command/` (project-local)
45-
/// 2. `~/.config/cortex/command/` (global)
44+
/// 1. `.cortex/commands/` (project-local)
45+
/// 2. `~/.config/cortex/commands/` (global)
4646
pub fn new() -> Self {
4747
let mut search_dirs = Vec::new();
4848

4949
// Project-local commands
50-
search_dirs.push(PathBuf::from(".cortex/command"));
50+
search_dirs.push(PathBuf::from(".cortex/commands"));
5151

5252
// Global commands
5353
if let Some(config_dir) = dirs::config_dir() {
54-
search_dirs.push(config_dir.join("Cortex").join("command"));
54+
search_dirs.push(config_dir.join("cortex").join("commands"));
5555
}
5656

5757
Self { search_dirs }
@@ -245,11 +245,11 @@ pub mod sync {
245245
let mut dirs = Vec::new();
246246

247247
// Project-local
248-
dirs.push(PathBuf::from(".cortex/command"));
248+
dirs.push(PathBuf::from(".cortex/commands"));
249249

250250
// Global
251251
if let Some(config_dir) = dirs::config_dir() {
252-
dirs.push(config_dir.join("Cortex").join("command"));
252+
dirs.push(config_dir.join("cortex").join("commands"));
253253
}
254254

255255
dirs

0 commit comments

Comments
 (0)