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

Fix debug property, README #10

Merged
merged 3 commits into from
Jan 27, 2019
Merged
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
15 changes: 13 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ module.exports = {
backgroundColor: "#004"
}
],
stripAnsiColors: true, //default
stripAnsiSequences: true, //default
debug: false //default
}
}
Expand All @@ -97,6 +97,17 @@ module.exports = {

This section defines different patterns for parsing prompt components: username, host, path.

Note that `pattern` is a string literal passed to the `RegExp()`
constructor, so remember to escape backslashes in your regexp. For
example, if you used a site like [regex101.com](https://regex101.com)
to verify that your regexp `/\[(\w+):\s*(\w+)\](\s*\$)/` is correct,
you would double each backslash and write the pattern as:

```
pattern: '\\[(\\w+):\\s*(\\w+)\\](\\s*\\$)',
```
The values for `hostname`, `username`, and `pattern` are indexes into the match array returned by `RegExp#exec`.

For example, define a pattern for MacOS bash default prompt:

```
Expand Down Expand Up @@ -133,7 +144,7 @@ See [here](http://ascii-table.com/ansi-escape-sequences-vt-100.php) for more det

### autoProfile.debug (Default: false)

If enabled, debug informations are written to console
If enabled, debug information is written to the DevTools console

## Caveat

Expand Down
3 changes: 2 additions & 1 deletion config.example
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@
backgroundColor: '#004'
}
],
stripAnsiSequences: true //default
stripAnsiSequences: true, //default
debug: false, //default
}
}
}
2 changes: 2 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@ function formatConfiguration(autoProfileConfig) {
if (!autoProfileConfig || !autoProfileConfig.prompts || !autoProfileConfig.profiles) {
return formattedConfig;
}
formattedConfig.debug = autoProfileConfig.debug;
formattedConfig.stripAnsiSequences = autoProfileConfig.stripAnsiSequences;
formattedConfig.prompts = autoProfileConfig.prompts;
const profiles = [];
autoProfileConfig.profiles.forEach(profile => {
Expand Down