Fixed command plugins section
This commit is contained in:
parent
f547a0e132
commit
84b2628bd7
@ -30,16 +30,16 @@ dotnet add package --source devdisciples --version 1.0.0 MycroForge.PluginTempla
|
||||
Generate a template plugin project by running the following command.
|
||||
|
||||
```
|
||||
m4g plugin init My.Dotenv.Plugin
|
||||
m4g plugin init Dotenv.Plugin
|
||||
```
|
||||
|
||||
This should generate the following folder structure.
|
||||
|
||||
```
|
||||
My.Dotenv.Plugin
|
||||
Dotenv.Plugin
|
||||
┣ 📜HelloWorldCommand.cs
|
||||
┣ 📜HelloWorldCommandPlugin.cs
|
||||
┗ 📜My.Dotenv.Plugin.csproj
|
||||
┗ 📜Dotenv.Plugin.csproj
|
||||
```
|
||||
|
||||
Rename the following files. Also rename the classes in these files, the easiest way in `vscode` is to right click the class name and select the `Rename symbol` action. Note that this action does not (necessarily) rename the files!
|
||||
@ -49,7 +49,7 @@ HelloWorldCommand.cs => DotenvCommand.cs
|
||||
HelloWorldCommandPlugin.cs => DotenvCommandPlugin.cs
|
||||
```
|
||||
|
||||
Modify `Name` property in `DotenvCommandPlugin.cs`.
|
||||
Modify the `Name` property and the reference to `HelloWorldCommand` in `DotenvCommandPlugin.cs`.
|
||||
|
||||
```cs
|
||||
// Before
|
||||
@ -66,11 +66,11 @@ public class DotenvCommandPlugin : ICommandPlugin
|
||||
// After
|
||||
public class DotenvCommandPlugin : ICommandPlugin
|
||||
{
|
||||
public string Name => "My.Dotenv.Plugin";
|
||||
public string Name => "Dotenv.Plugin";
|
||||
|
||||
public void RegisterServices(IServiceCollection services)
|
||||
{
|
||||
services.AddScoped<ISubCommandOf<RootCommand>, HelloWorldCommand>();
|
||||
services.AddScoped<ISubCommandOf<RootCommand>, DotenvCommand>();
|
||||
}
|
||||
}
|
||||
```
|
||||
@ -153,7 +153,7 @@ public class DotenvCommand : Command, ISubCommandOf<RootCommand>
|
||||
|
||||
## Install the plugin
|
||||
|
||||
Open a terminal an make sure you're in the root directory of the plugin, i.e. the `My.Dotenv.Plugin` folder.
|
||||
Open a terminal an make sure you're in the root directory of the plugin, i.e. the `Dotenv.Plugin` folder.
|
||||
Run the following command to install the plugin.
|
||||
|
||||
```
|
||||
@ -169,7 +169,7 @@ Try running `m4g dotenv "FIRSTNAME=JOHN;LASTNAME=JOE"`, this should generate a `
|
||||
|
||||
## Uninstall the plugin
|
||||
|
||||
Uninstall the plugin by running `m4g plugin install My.Dotenv.Plugin`.
|
||||
Uninstall the plugin by running `m4g plugin uninstall Dotenv.Plugin`.
|
||||
|
||||
## Resources
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user