opencode: align commands directory with upstream documentation
This commit is contained in:
committed by
Austin Horstman
parent
49088dc2e7
commit
a5e824c862
@@ -213,11 +213,11 @@ in
|
||||
|
||||
If an attribute set is used, the attribute name becomes the command filename,
|
||||
and the value is either:
|
||||
- Inline content as a string (creates `opencode/command/<name>.md`)
|
||||
- A path to a file (creates `opencode/command/<name>.md`)
|
||||
- Inline content as a string (creates `opencode/commands/<name>.md`)
|
||||
- A path to a file (creates `opencode/commands/<name>.md`)
|
||||
|
||||
If a path is used, it is expected to contain command files.
|
||||
The directory is symlinked to {file}`$XDG_CONFIG_HOME/opencode/command/`.
|
||||
The directory is symlinked to {file}`$XDG_CONFIG_HOME/opencode/commands/`.
|
||||
'';
|
||||
example = lib.literalExpression ''
|
||||
{
|
||||
@@ -484,7 +484,7 @@ in
|
||||
})
|
||||
);
|
||||
|
||||
"opencode/command" = mkIf (lib.isPath cfg.commands) {
|
||||
"opencode/commands" = mkIf (lib.isPath cfg.commands) {
|
||||
source = cfg.commands;
|
||||
recursive = true;
|
||||
};
|
||||
@@ -512,7 +512,7 @@ in
|
||||
// lib.optionalAttrs (builtins.isAttrs cfg.commands) (
|
||||
lib.mapAttrs' (
|
||||
name: content:
|
||||
lib.nameValuePair "opencode/command/${name}.md" (
|
||||
lib.nameValuePair "opencode/commands/${name}.md" (
|
||||
if lib.isPath content then { source = content; } else { text = content; }
|
||||
)
|
||||
) cfg.commands
|
||||
|
||||
@@ -5,11 +5,11 @@
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
assertFileExists home-files/.config/opencode/command/changelog.md
|
||||
assertFileExists home-files/.config/opencode/command/commit.md
|
||||
assertFileContent home-files/.config/opencode/command/changelog.md \
|
||||
assertFileExists home-files/.config/opencode/commands/changelog.md
|
||||
assertFileExists home-files/.config/opencode/commands/commit.md
|
||||
assertFileContent home-files/.config/opencode/commands/changelog.md \
|
||||
${./commands-bulk/changelog.md}
|
||||
assertFileContent home-files/.config/opencode/command/commit.md \
|
||||
assertFileContent home-files/.config/opencode/commands/commit.md \
|
||||
${./commands-bulk/commit.md}
|
||||
'';
|
||||
}
|
||||
|
||||
@@ -17,11 +17,11 @@
|
||||
};
|
||||
};
|
||||
nmt.script = ''
|
||||
assertFileExists home-files/.config/opencode/command/changelog.md
|
||||
assertFileExists home-files/.config/opencode/command/commit.md
|
||||
assertFileContent home-files/.config/opencode/command/changelog.md \
|
||||
assertFileExists home-files/.config/opencode/commands/changelog.md
|
||||
assertFileExists home-files/.config/opencode/commands/commit.md
|
||||
assertFileContent home-files/.config/opencode/commands/changelog.md \
|
||||
${./changelog-command.md}
|
||||
assertFileContent home-files/.config/opencode/command/commit.md \
|
||||
assertFileContent home-files/.config/opencode/commands/commit.md \
|
||||
${./commit-command.md}
|
||||
'';
|
||||
}
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
};
|
||||
};
|
||||
nmt.script = ''
|
||||
assertFileExists home-files/.config/opencode/command/test-command.md
|
||||
assertFileContent home-files/.config/opencode/command/test-command.md \
|
||||
assertFileExists home-files/.config/opencode/commands/test-command.md
|
||||
assertFileContent home-files/.config/opencode/commands/test-command.md \
|
||||
${./test-command.md}
|
||||
'';
|
||||
}
|
||||
|
||||
@@ -57,10 +57,10 @@
|
||||
};
|
||||
nmt.script = ''
|
||||
# Commands
|
||||
assertFileExists home-files/.config/opencode/command/inline-command.md
|
||||
assertFileExists home-files/.config/opencode/command/path-command.md
|
||||
assertFileExists home-files/.config/opencode/commands/inline-command.md
|
||||
assertFileExists home-files/.config/opencode/commands/path-command.md
|
||||
|
||||
assertFileContent home-files/.config/opencode/command/path-command.md \
|
||||
assertFileContent home-files/.config/opencode/commands/path-command.md \
|
||||
${./test-command.md}
|
||||
|
||||
# Agents
|
||||
|
||||
Reference in New Issue
Block a user