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 3 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
94 changes: 94 additions & 0 deletions src/wp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,100 @@ const completionSpec: Fig.Spec = {
// args: [{}],
// options: global_parameters,
// },
{
name: "acorn",
description: "Acorn commands for WordPress",
subcommands: [
{
name: "about",
description: "Display basic information about your application",
},
{
name: "db",
description: "Start a new database CLI session",
},
{
name: "migrate",
description: "Run the database migrations",
},
{
name: "acorn:install",
description: "Install Acorn into the application",
},
{
name: "cache:clear",
description: "Flush the application cache",
},
{
name: "cache:forget",
description: "Remove an item from the cache",
},
{
name: "db:seed",
description: "Seed the database with records",
},
{
name: "db:wipe",
description: "Drop all tables, views, and types",
},
{
name: "key:generate",
description: "Set the application key",
},
{
name: "make:middleware",
description: "Create a new middleware class",
},
{
name: "make:migration",
description: "Create a new migration file",
},
{
name: "migrate:fresh",
description: "Drop all tables and re-run all migrations",
},
{
name: "migrate:install",
description: "Create the migration repository",
},
{
name: "migrate:refresh",
description: "Reset and re-run all migrations",
},
{
name: "migrate:reset",
description: "Rollback all database migrations",
},
{
name: "migrate:rollback",
description: "Rollback the last database migration",
},
{
name: "migrate:status",
description: "Show the status of each migration",
},
{
name: "route:cache",
description: "Create a route cache file for faster route registration",
},
{
name: "route:clear",
description: "Remove the route cache file",
},
{
name: "route:list",
description: "List all registered routes",
},
{
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