Skip to content

Commit

Permalink
Improve script a little
Browse files Browse the repository at this point in the history
  • Loading branch information
Slackadays committed Oct 16, 2024
1 parent f4521d6 commit 0c1dbb2
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/cb/src/actions/script.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,17 @@ void script() {
if (io_type == IOType::File) {
if (copying.items.size() > 1) {
error_exit("%s", formatColors("[error][inverse] โœ˜ [noinverse] You can only set one script file to run. [help]โฌค Try providing a single script file instead.[blank]\n"));
return;
}
if (copying.items.empty()) {
error_exit("%s", formatColors("[error][inverse] โœ˜ [noinverse] You need to provide a script file to run. [help]โฌค Try providing a script file instead.[blank]\n"));
stopIndicator();
if (fs::is_regular_file(path.metadata.script)) {
fprintf(stderr, formatColors("[info]โ”ƒ The current script is: [help]%s[blank]\n").data(), fileContents(path.metadata.script).value().data());
} else {

fprintf(stderr, "%s", formatColors("[error][inverse] โœ˜ [noinverse] No script is currently set. [help]โฌค Try providing a script file to set one.[blank]\n").data());
}
return;
}
if (copying.items.at(0).string() == "") {
fs::remove(path.metadata.script);
Expand Down

0 comments on commit 0c1dbb2

Please sign in to comment.