Skip to content

Commit

Permalink
Merge branch 'master' into improve/pretty
Browse files Browse the repository at this point in the history
  • Loading branch information
ken-matsui authored Jan 6, 2021
2 parents 34527e3 + 324351a commit 9fcc850
Show file tree
Hide file tree
Showing 15 changed files with 222 additions and 200 deletions.
1 change: 1 addition & 0 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ jobs:
sudo apt-get install -y -qq pkg-config cmake ${{ matrix.compiler.pacakge }}
- name: Restore & Cache CMake build results
if: matrix.build_type != 'Coverage'
uses: actions/cache@v2.1.3
with:
path: build
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ macos-10.15, macos-11.0 ]
os: [ macos-10.15 ] # macos-11.0
build_type: [ Debug, Release ]
env:
CACHE_KEY_PREFIX: ${{ matrix.os }}-${{ matrix.build_type }}
Expand Down
9 changes: 5 additions & 4 deletions include/poac/cmd/init.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include <poac/cmd/new.hpp>
#include <poac/core/validator.hpp>
#include <poac/util/termcolor2/termcolor2.hpp>
#include <poac/util/termcolor2/literals_extra.hpp>

namespace poac::cmd::init {
struct Options {
Expand All @@ -24,8 +25,6 @@ namespace poac::cmd::init {

[[nodiscard]] mitama::result<void, std::string>
init(std::string_view package_name, init::Options&& opts) {
using termcolor2::color_literals::operator""_green;

PLOG_VERBOSE << "Creating ./poac.toml";
std::ofstream ofs_config("poac.toml");
switch (opts.type) {
Expand All @@ -36,9 +35,11 @@ namespace poac::cmd::init {
ofs_config << _new::files::poac_toml(package_name);
break;
}

using termcolor2::color_literals::operator""_bold_green;
PLOG_INFO << fmt::format(
"{}{} `{}` package",
"Created: "_green,
"{:>25} {} `{}` package",
"Created"_bold_green,
opts.type,
package_name
);
Expand Down
8 changes: 4 additions & 4 deletions include/poac/cmd/new.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include <poac/core/validator.hpp>
#include <poac/util/git2-cpp/git2.hpp>
#include <poac/util/termcolor2/termcolor2.hpp>
#include <poac/util/termcolor2/literals_extra.hpp>
#include <poac/util/misc.hpp>

namespace poac::cmd::_new {
Expand Down Expand Up @@ -130,8 +131,6 @@ namespace poac::cmd::_new {

[[nodiscard]] mitama::result<void, std::string>
_new(_new::Options&& opts) {
using termcolor2::color_literals::operator""_green;

std::ofstream ofs;
for (auto&& [name, text] : create_template_files(opts)) {
const std::string& file_path = (opts.package_name / name).string();
Expand All @@ -144,9 +143,10 @@ namespace poac::cmd::_new {
);
git2::repository().init(opts.package_name);

using termcolor2::color_literals::operator""_bold_green;
PLOG_INFO << fmt::format(
"{}{} `{}` package",
"Created: "_green,
"{:>25} {} `{}` package",
"Created"_bold_green,
opts.type,
opts.package_name
);
Expand Down
3 changes: 2 additions & 1 deletion include/poac/config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ namespace poac {
} // end namespace

namespace poac::config::path {
inline const std::filesystem::path root(util::misc::expand_user() / std::filesystem::path(".poac"));
inline const std::filesystem::path user = util::misc::expand_user().unwrap();
inline const std::filesystem::path root(user / ".poac");
inline const std::filesystem::path cache_dir(root / "cache");
inline const std::filesystem::path archive_dir(cache_dir / "archive");
inline const std::filesystem::path extract_dir(cache_dir / "extract");
Expand Down
1 change: 0 additions & 1 deletion include/poac/core.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
#define POAC_CORE_HPP

#include <poac/core/builder.hpp>
#include <poac/core/except.hpp>
#include <poac/core/resolver.hpp>
#include <poac/core/validator.hpp>

Expand Down
Loading

0 comments on commit 9fcc850

Please sign in to comment.