forked from lix-project/lix
nix copy: Move --from / --to check
This means you now get an error message *before* stuff gets built: $ nix copy .#hydraJobs.vendoredCrates error: you must pass '--from' and/or '--to' Try 'nix --help' for more information.
This commit is contained in:
parent
70bcd6a55c
commit
9c4e05766b
|
@ -80,11 +80,16 @@ struct CmdCopy : StorePathsCommand
|
|||
return srcUri.empty() ? StoreCommand::createStore() : openStore(srcUri);
|
||||
}
|
||||
|
||||
void run(ref<Store> srcStore, StorePaths storePaths) override
|
||||
void run(ref<Store> store) override
|
||||
{
|
||||
if (srcUri.empty() && dstUri.empty())
|
||||
throw UsageError("you must pass '--from' and/or '--to'");
|
||||
|
||||
StorePathsCommand::run(store);
|
||||
}
|
||||
|
||||
void run(ref<Store> srcStore, StorePaths storePaths) override
|
||||
{
|
||||
ref<Store> dstStore = dstUri.empty() ? openStore() : openStore(dstUri);
|
||||
|
||||
copyPaths(srcStore, dstStore, storePathsToSet(storePaths),
|
||||
|
|
Loading…
Reference in a new issue