aboutsummaryrefslogtreecommitdiff
path: root/toolsrc/src/vcpkg.cpp
diff options
context:
space:
mode:
authorThomas Fussell <thomas.fussell@gmail.com>2017-03-17 00:33:06 -0400
committerThomas Fussell <thomas.fussell@gmail.com>2017-03-17 00:33:06 -0400
commitd821b0a28a7223d0b49745c53a3ff032fcb001c8 (patch)
tree12e13d5ff298a4e4b4f946ceb90b49cbfbe2d2c9 /toolsrc/src/vcpkg.cpp
parent4921636f6bc92e041a410870ce564615c85a6cfb (diff)
parent01b1e39c6a006adba7b9cf2af758be679d0b7eb9 (diff)
downloadvcpkg-d821b0a28a7223d0b49745c53a3ff032fcb001c8.tar.gz
vcpkg-d821b0a28a7223d0b49745c53a3ff032fcb001c8.zip
Merge branch 'master' of https://github.com/Microsoft/vcpkg
Diffstat (limited to 'toolsrc/src/vcpkg.cpp')
-rw-r--r--toolsrc/src/vcpkg.cpp18
1 files changed, 8 insertions, 10 deletions
diff --git a/toolsrc/src/vcpkg.cpp b/toolsrc/src/vcpkg.cpp
index e94d2538b..6c81d54f9 100644
--- a/toolsrc/src/vcpkg.cpp
+++ b/toolsrc/src/vcpkg.cpp
@@ -1,7 +1,6 @@
#define WIN32_LEAN_AND_MEAN
#include <Windows.h>
-#include <iostream>
#include <fstream>
#include <memory>
#include <cassert>
@@ -14,11 +13,10 @@
#include "Paragraphs.h"
#include "vcpkg_Strings.h"
#include "vcpkg_Chrono.h"
+#include "vcpkglib.h"
using namespace vcpkg;
-bool g_debugging = false;
-
void invalid_command(const std::string& cmd)
{
System::println(System::color::error, "invalid command: %s", cmd);
@@ -58,13 +56,13 @@ static void inner(const vcpkg_cmd_arguments& args)
}
}
- Checks::check_exit(!vcpkg_root_dir.empty(), "Error: Could not detect vcpkg-root.");
+ Checks::check_exit(VCPKG_LINE_INFO, !vcpkg_root_dir.empty(), "Error: Could not detect vcpkg-root.");
const expected<vcpkg_paths> expected_paths = vcpkg_paths::create(vcpkg_root_dir);
- Checks::check_exit(!expected_paths.error_code(), "Error: Invalid vcpkg root directory %s: %s", vcpkg_root_dir.string(), expected_paths.error_code().message());
- const vcpkg_paths paths = expected_paths.get_or_throw();
+ Checks::check_exit(VCPKG_LINE_INFO, !expected_paths.error_code(), "Error: Invalid vcpkg root directory %s: %s", vcpkg_root_dir.string(), expected_paths.error_code().message());
+ const vcpkg_paths paths = expected_paths.get_or_throw(VCPKG_LINE_INFO);
int exit_code = _wchdir(paths.root.c_str());
- Checks::check_exit(exit_code == 0, "Changing the working dir failed");
+ Checks::check_exit(VCPKG_LINE_INFO, exit_code == 0, "Changing the working dir failed");
if (auto command_function = Commands::find(args.command, Commands::get_available_commands_type_b()))
{
@@ -113,7 +111,7 @@ static void loadConfig()
try
{
- std::string config_contents = Files::read_contents(localappdata / "vcpkg" / "config").get_or_throw();
+ std::string config_contents = Files::read_contents(localappdata / "vcpkg" / "config").get_or_throw(VCPKG_LINE_INFO);
std::unordered_map<std::string, std::string> keys;
auto pghs = Paragraphs::parse_paragraphs(config_contents);
@@ -128,7 +126,7 @@ static void loadConfig()
auto user_id = keys["User-Id"];
auto user_time = keys["User-Since"];
- Checks::check_throw(!user_id.empty() && !user_time.empty(), ""); // Use as goto to the catch statement
+ Checks::check_throw(VCPKG_LINE_INFO, !user_id.empty() && !user_time.empty(), ""); // Use as goto to the catch statement
SetUserInformation(user_id, user_time);
return;
@@ -156,7 +154,7 @@ static void loadConfig()
static std::string trim_path_from_command_line(const std::string& full_command_line)
{
- Checks::check_exit(full_command_line.size() > 0, "Internal failure - cannot have empty command line");
+ Checks::check_exit(VCPKG_LINE_INFO, full_command_line.size() > 0, "Internal failure - cannot have empty command line");
if (full_command_line[0] == '"')
{