Skip to content

Commit

Permalink
Fix issue with not some wrong commands (#5266)
Browse files Browse the repository at this point in the history
There is error on https://detekt.dev/docs/gettingstarted/cli/ page.

instead of `curl -sSLO https://github.com/detekt/detekt/releases/download/v1.21.0/detekt-cli-1.21.0.zip
unzip detekt-cli-1.21.0.zip
./detekt-cli-1.21.0/bin/detekt-cli --help` it shows 'curl -sSLO https://github.com/detekt/detekt/releases/download/v1.21.0/detekt-cli-[detekt_version].zip
unzip detekt-cli-[detekt_version].zip
./detekt-cli-[detekt_version]/bin/detekt-cli --help' command.
I suppose this issue is happening because detekt plugin uses 'replace' in node instead of 'replaceAll'.
Or I can also suggest to use `do while` instead of `if` block.
  • Loading branch information
Ridje committed Sep 4, 2022
1 parent 720ac95 commit 361eb57
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion website/src/remark/detektVersionReplace.js
Expand Up @@ -9,7 +9,7 @@ const plugin = (options) => {
const transformer = async (ast) => {
visit(ast, "code", (node) => {
if (node.value.includes("[detekt_version]")) {
node.value = node.value.replace("[detekt_version]", detektVersion);
node.value = node.value.replaceAll("[detekt_version]", detektVersion);
}
});
};
Expand Down

0 comments on commit 361eb57

Please sign in to comment.