Skip to content

Commit 5cdc2bc

Browse files
committed
Fix version handling for duplicate. (#64)
1 parent 34f8119 commit 5cdc2bc

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

LxRunOffline/main.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,10 +118,11 @@ int wmain(int argc, wchar_t **argv) {
118118
reg_config conf;
119119
conf.load_distro(name, config_all);
120120
if (!conf_path.empty()) conf.load_file(conf_path);
121-
register_distro(new_name, dir, ver);
122-
conf.configure_distro(new_name, config_all);
123121
auto ov = get_distro_version(name);
124-
auto writer = select_wsl_writer(ver ? ver : ov, dir);
122+
auto nv = ver ? ver : ov;
123+
register_distro(new_name, dir, nv);
124+
conf.configure_distro(new_name, config_all);
125+
auto writer = select_wsl_writer(nv, dir);
125126
select_wsl_reader(ov, get_distro_dir(name))->run(*writer);
126127
} else if (!wcscmp(argv[1], L"e") || !wcscmp(argv[1], L"export")) {
127128
wstr file;

0 commit comments

Comments
 (0)