Skip to content

Commit

Permalink
new handling
Browse files Browse the repository at this point in the history
  • Loading branch information
ken-matsui committed Dec 20, 2023
1 parent b14048f commit aedf16d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 28 deletions.
7 changes: 6 additions & 1 deletion src/Cmd/New.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

#include <fstream>
#include <iostream>
#include <stdexcept>

static inline constexpr StringRef mainCc =
"#include <iostream>\n\n"
Expand Down Expand Up @@ -41,6 +42,10 @@ static void writeToFile(std::ofstream& ofs, const Path& fpath, StringRef text) {
ofs << text;
}
ofs.close();

if (!ofs) {
throw std::runtime_error("writing `" + fpath.string() + "` failed");
}
ofs.clear();
}

Expand Down Expand Up @@ -70,7 +75,7 @@ static void createTemplateFiles(const bool isBin, const Path& projectName) {
}
}

bool verifyPackageName(StringRef name) {
bool verifyPackageName(StringRef name) noexcept {
// Empty
if (name.empty()) {
Logger::error("missing package name");
Expand Down
27 changes: 0 additions & 27 deletions srcOld/Util/File.hpp

This file was deleted.

0 comments on commit aedf16d

Please sign in to comment.