Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[cli/launch] remove default mount target from --mount #3756

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions src/client/cli/cmd/launch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -347,10 +347,9 @@ mp::ParseCode cmd::Launch::parse_args(mp::ArgParser* parser)
for (const auto& value : parser->values(mountOption))
{
// this is needed so that Windows absolute paths are not split at the colon following the drive letter
auto colon_split = QRegularExpression{R"(^[A-Za-z]:[\\/].*)"}.match(value).hasMatch();
auto mount_source = value.section(':', 0, colon_split);
auto mount_target = value.section(':', colon_split + 1);
mount_target = mount_target.isEmpty() ? mount_source : mount_target;
const auto colon_split = QRegularExpression{R"(^[A-Za-z]:[\\/].*)"}.match(value).hasMatch();
const auto mount_source = value.section(':', 0, colon_split);
const auto mount_target = value.section(':', colon_split + 1);

// Validate source directory of client side mounts
QFileInfo source_dir(mount_source);
Expand Down
2 changes: 1 addition & 1 deletion tests/test_cli_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1235,7 +1235,7 @@ TEST_F(Client, launch_cmd_mount_option)
const QTemporaryDir fake_directory{};

const auto fake_source = fake_directory.path().toStdString();
const auto fake_target = fake_source;
const auto fake_target = "";
const auto instance_name = "some_instance";

const auto mount_matcher = make_mount_matcher(fake_source, fake_target, instance_name);
Expand Down
Loading