浏览代码

Clean up sdist-create output

default_compile_flags
vector-of-bool 3 年前
父节点
当前提交
c960646256
共有 2 个文件被更改,包括 17 次插入8 次删除
  1. +17
    -7
      src/dds/cli/cmd/sdist_create.cpp
  2. +0
    -1
      src/dds/sdist/dist.cpp

+ 17
- 7
src/dds/cli/cmd/sdist_create.cpp 查看文件

@@ -5,8 +5,11 @@

#include <boost/leaf/common.hpp>
#include <boost/leaf/handle_exception.hpp>
#include <fansi/styled.hpp>
#include <fmt/core.h>

using namespace fansi::literals;

namespace dds::cli::cmd {

int sdist_create(const options& opts) {
@@ -23,20 +26,27 @@ int sdist_create(const options& opts) {
auto default_filename = fmt::format("{}.tar.gz", pkg_man.id.to_string());
auto filepath = opts.out_path.value_or(fs::current_path() / default_filename);
create_sdist_targz(filepath, params);
dds_log(info,
"Created source dirtribution archive: .bold.cyan[{}]"_styled,
filepath.string());
return 0;
},
[&](boost::leaf::bad_result, e_missing_file missing, e_human_message msg) {
dds_log(error,
"A required file is missing for creating a source distribution for [{}]",
params.project_dir.string());
dds_log(error, "Error: {}", msg.value);
dds_log(error, "Missing file: {}", missing.path.string());
dds_log(
error,
"A required file is missing for creating a source distribution for [.bold.yellow[{}]]"_styled,
params.project_dir.string());
dds_log(error, "Error: .bold.yellow[{}]"_styled, msg.value);
dds_log(error, "Missing file: .bold.red[{}]"_styled, missing.path.string());
write_error_marker("no-package-json5");
return 1;
},
[&](std::error_code ec, e_human_message msg, boost::leaf::e_file_name file) {
dds_log(error, "Error: {}", msg.value);
dds_log(error, "Failed to access file [{}]: {}", file.value, ec.message());
dds_log(error, "Error: .bold.red[{}]"_styled, msg.value);
dds_log(error,
"Failed to access file [.bold.red[{}]]: .br.yellow[{}]",
file.value,
ec.message());
write_error_marker("failed-package-json5-scan");
return 1;
});

+ 0
- 1
src/dds/sdist/dist.cpp 查看文件

@@ -116,7 +116,6 @@ sdist dds::create_sdist_in_dir(path_ref out, const sdist_params& params) {

auto pkg_man = package_manifest::load_from_file(*man_path);
sdist_export_file(out, params.project_dir, *man_path);
dds_log(info, "Generated export as {}", pkg_man.id.to_string());
return sdist::from_directory(out);
}


正在加载...
取消
保存