Update color scheme; Change default tmp path; Fix runtime if target not exists
This commit is contained in:
parent
9f22ea05a6
commit
7e4141b282
|
@ -76,9 +76,11 @@ Clippy::TargetPtr Clippy::GetScriptTarget(
|
|||
|
||||
auto cfg = p->GetConfig();
|
||||
auto result = cfg.GetTarget(args[1]);
|
||||
if (enable_aliases_) {
|
||||
|
||||
if (result && enable_aliases_) {
|
||||
result->PushFront("shopt -s expand_aliases");
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
|
@ -69,12 +69,14 @@ class RunShellScript : public Target {
|
|||
}
|
||||
|
||||
void Execute() override {
|
||||
cppshell::Shell s;
|
||||
auto tmp_path = utils::GetProjectDirectory() / "tmp";
|
||||
std::filesystem::create_directories(tmp_path);
|
||||
|
||||
cppshell::Shell s("bash", tmp_path);
|
||||
|
||||
for (auto& command : commands_) {
|
||||
std::cout << rang::fg::green << rang::style::bold << "-> "
|
||||
<< rang::fg::reset << command << rang::style::reset
|
||||
<< std::endl;
|
||||
std::cout << rang::fg::green << rang::style::bold << rang::bgB::blue << "->" << rang::fg::reset
|
||||
<< rang::bg::reset << " " << command << rang::style::reset << std::endl;
|
||||
s.Execute(command);
|
||||
if (int err = s.GetExitCodeLastCommand(); err != 0) {
|
||||
std::cout << rang::fg::red << rang::style::bold
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#include <utils/editor.hpp>
|
||||
#include <utils/config_path.hpp>
|
||||
|
||||
#include <cppshell/shell.hpp>
|
||||
|
||||
|
@ -6,7 +7,10 @@ namespace utils {
|
|||
void OpenEditor(const std::string& file) {
|
||||
std::string editors[] = {"nvim", "vim", "vi"};
|
||||
|
||||
cppshell::Shell shell;
|
||||
auto tmp_path = utils::GetProjectDirectory() / "tmp";
|
||||
std::filesystem::create_directories(tmp_path);
|
||||
|
||||
cppshell::Shell shell("bash", tmp_path);
|
||||
|
||||
for (auto& editor : editors) {
|
||||
shell.Execute(editor + " " + file);
|
||||
|
|
Loading…
Reference in a new issue