Skip to content

feat(sake): update spec #2584

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 7, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 41 additions & 2 deletions src/sake.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,19 @@ const commonOptions: Fig.Option[] = [
{
name: ["--config-path", "-c"],
description: "Specify the path to the configuration file",
args: {
name: "path",
template: "filepaths",
},
isPersistent: true,
},
{
name: ["--sake-app-path", "-s"],
description: "Specify the path for the SakeApp package",
args: {
name: "path",
template: "folders",
},
isPersistent: true,
},
];
Expand All @@ -21,12 +29,21 @@ const commonCommandSpecificOptions: Fig.Option[] = [
},
priority: 55,
},
{
name: ["--sake-app-prebuilt-binary-path", "-b"],
description: "Specify the path to the prebuilt SakeApp binary",
args: {
name: "path",
template: "filepaths",
},
priority: 55,
},
];

const completionSpec: Fig.Spec = {
name: "sake",
description:
"🍶 Swift-based utility for managing command execution with dependencies and conditions, inspired by Make",
"🍶 Swift-based utility for managing project commands, inspired by Make",
generateSpec: async (_tokens, executeShellCommand) => {
const { stdout } = await executeShellCommand({
command: "sake",
Expand All @@ -38,7 +55,7 @@ const completionSpec: Fig.Spec = {
const group = commands.groups[groupName];
return [
...acc,
...group.map((command) => {
...group.map((command: { name: string; description: string }) => {
return {
name: command.name,
description: command.description || "The command to run",
Expand Down Expand Up @@ -69,6 +86,11 @@ const completionSpec: Fig.Spec = {
"Remove all build artifacts generated by the SakeApp to ensure a clean state for future builds",
options: [...commonOptions],
},
{
name: "edit",
description: "Open the SakeApp in Xcode (macOS only)",
options: [...commonOptions],
},
{
name: "list",
description: "List all available commands defined in the SakeApp",
Expand All @@ -82,6 +104,18 @@ const completionSpec: Fig.Spec = {
},
],
},
{
name: "build",
description: "Manually trigger a rebuild of the SakeApp",
options: [
...commonOptions,
{
name: "--show-bin-path",
description: "Print the path to the built SakeApp executable",
priority: 45,
},
],
},
{
name: "run",
description: "Run the specified command from the SakeApp",
Expand Down Expand Up @@ -119,6 +153,11 @@ const completionSpec: Fig.Spec = {
isPersistent: true,
priority: 40,
},
{
name: "--version",
description: "Show the version",
priority: 40,
},
],
};
export default completionSpec;