Skip to content

Commit

Permalink
Use the new test command in decai to avoid catting unexistent files
Browse files Browse the repository at this point in the history
  • Loading branch information
radare committed Sep 16, 2024
1 parent 2b3cf42 commit 34bfb70
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions decai/decai.r2.js
Original file line number Diff line number Diff line change
Expand Up @@ -326,10 +326,12 @@ You can also make r2ai -w talk to an 'r2ai-server' using this line:
let count = 0;
let text = "";
if (decaiContextFile !== "") {
if (r2.cmd2("test -f " + decaiContextFile).value === 0) {
text += "Context:\n";
text += "[RULES]\n";
text += r2.cmd("cat " + decaiContextFile);
text += "[/RULES]\n";
text += "[RULES]\n";
text += r2.cmd("cat " + decaiContextFile);
text += "[/RULES]\n";
}
}
const origColor = r2.cmd("e scr.color");
r2.cmd("e scr.color=0");
Expand Down

0 comments on commit 34bfb70

Please sign in to comment.