Skip to content
This repository has been archived by the owner on Feb 15, 2022. It is now read-only.

Commit

Permalink
Add instructions on how to debug fabrikate (#248)
Browse files Browse the repository at this point in the history
* Add instructions on how to debug fabrikate

* Fix spacing in readme
  • Loading branch information
edaena authored Aug 29, 2019
1 parent 56d5968 commit c3d4cdb
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions docs/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,46 @@ And run the linter with:
$ golangci-lint run
```

## Debugging Fabrikate
To debug Fabrikate on [Visual Studio Code](https://code.visualstudio.com/):
1. Open `main.go`
2. On the top menu select Debug > Start Debugging
3. It will prompt you to create a `launch.json` file for the go language, proceed to create it.
4. Update the configuration to debug specific `fabrikate` commands. Follow the instructions below.

### Debug Configuration
Initially the debug configuration will look like this:
```
"configurations": [
{
"name": "Launch",
"type": "go",
"request": "launch",
"mode": "auto",
"program": "${fileDirname}",
"env": {},
"args": []
}
]
```

You can specify what `fabrikate` commands you want to debug in the arguments. Below are some examples.

To debug the `install` command:
```
"args": ["install", "/home/edaena/Source/repos/sample-component"]
```

To debug the `generate` command:
```
"args": ["generate", "common"]
```

### Run the Debugger
For information about how to add breakpoints to the code and more detailed instructions on debugging refer to [Visual Studio Code Debugging](https://code.visualstudio.com/docs/editor/debugging).
1. Go to the `main.go` file
2. On the top menu select Debug > Start Debugging

## Contributing

This project welcomes contributions and suggestions. Most contributions require
Expand Down

0 comments on commit c3d4cdb

Please sign in to comment.