diff --git a/src/nix/copy.cc b/src/nix/copy.cc index 85c777d38..66993ac21 100644 --- a/src/nix/copy.cc +++ b/src/nix/copy.cc @@ -80,11 +80,16 @@ struct CmdCopy : StorePathsCommand return srcUri.empty() ? StoreCommand::createStore() : openStore(srcUri); } - void run(ref srcStore, StorePaths storePaths) override + void run(ref store) override { if (srcUri.empty() && dstUri.empty()) throw UsageError("you must pass '--from' and/or '--to'"); + StorePathsCommand::run(store); + } + + void run(ref srcStore, StorePaths storePaths) override + { ref dstStore = dstUri.empty() ? openStore() : openStore(dstUri); copyPaths(srcStore, dstStore, storePathsToSet(storePaths),