diff --git a/tools/parcel_adapter/main.cpp b/tools/parcel_adapter/main.cpp index 2aa1ee51..db990ca0 100644 --- a/tools/parcel_adapter/main.cpp +++ b/tools/parcel_adapter/main.cpp @@ -44,7 +44,7 @@ void createPackageJsonIfMissing(std::filesystem::path const& where, std::string } } -void copyParcelRc(std::filesystem::path const& from, std::filesystem::path const& to) +void copyIfNotExists(std::filesystem::path const& from, std::filesystem::path const& to) { if (std::filesystem::exists(from)) std::filesystem::copy_file(from, to, std::filesystem::copy_options::overwrite_existing); @@ -58,15 +58,16 @@ int main(int argc, char** argv) { std::cout << "Expected 3 argument: , but got " << argc - 1 << "\n"; - std::cout << "Usage: " << argv[0] << " " - << "\n"; + std::cout << "Usage: " << argv[0] << " " << "\n"; return 1; } createPackageJsonIfMissing(argv[1], argv[3]); - copyParcelRc( + + copyIfNotExists( std::filesystem::path{argv[1]}.parent_path() / ".parcelrc", std::filesystem::path{argv[2]}.parent_path() / ".parcelrc"); + std::ifstream ifs(argv[1], std::ios_base::binary); if (!ifs.is_open()) {