Skip to content
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

Add Acorn commands support for WordPress (roots/acorn) #2448

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
19 changes: 12 additions & 7 deletions src/node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,19 @@ const completionSpec: Fig.Subcommand = {
},
],
generateSpec: async (tokens, executeShellCommand) => {
const isAdonisJsonPresentCommand = "test -f .adonisrc.json";
const isAdonisJsonPresent = await executeShellCommand({
command: "bash",
args: ["-c", "test -f .adonisrc.json"],
});

const isAdonisRcTsPresent = await executeShellCommand({
command: "bash",
args: ["-c", "test -f adonisrc.ts"],
});

if (
(
await executeShellCommand({
command: "bash",
args: ["-c", "isAdonisJsonPresentCommand"],
})
).status === 0
isAdonisJsonPresent.status === 0 ||
isAdonisRcTsPresent.status === 0
) {
return {
name: "node",
Expand Down
78 changes: 78 additions & 0 deletions src/wp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,84 @@ const completionSpec: Fig.Spec = {
// args: [{}],
// options: global_parameters,
// },
{
name: "acorn",
description: "Acorn commands for WordPress",
subcommands: [
{
name: "clear-compiled",
description: "Remove the compiled class file",
},
{
name: "completion",
description: "Dump the shell completion script",
},
{
name: "env",
description: "Display the current framework environment",
},
{
name: "help",
description: "Display help for a command",
},
{
name: "list",
description: "List commands",
},
{
name: "optimize",
description: "Cache the framework bootstrap files",
},
{
name: "acorn-init",
description: "Initializes required paths in the base directory",
},
{
name: "config:cache",
description: "Create a cache file for faster configuration loading",
},
{
name: "config:clear",
description: "Remove the configuration cache file",
},
{
name: "optimize:clear",
description: "Remove the cached bootstrap files",
},
{
name: "make:command",
description: "Create a new Artisan command",
},
{
name: "make:component",
description: "Create a new view component class",
},
{
name: "make:composer",
description: "Create a new view composer class",
},
{
name: "make:provider",
description: "Create a new service provider class",
},
{
name: "package:discover",
description: "Rebuild the cached package manifest",
},
{
name: "vendor:publish",
description: "Publish any publishable assets from vendor packages",
},
{
name: "view:cache",
description: "Compile all of the application's Blade templates",
},
{
name: "view:clear",
description: "Clear all compiled view files",
},
],
},
{
name: "cache",
description:
Expand Down
Loading