diff options
author | Wil Taylor <cert@wiltaylor.dev> | 2020-11-21 14:28:49 +1000 |
---|---|---|
committer | Wil Taylor <cert@wiltaylor.dev> | 2020-11-21 14:28:49 +1000 |
commit | c3bad73e27a5bda3f8f8c768cec818c52b0f95e3 (patch) | |
tree | 1d3cb32b77cbad5f32f4f7285b2b17f76dd32c67 /src/nix/bundle.cc | |
parent | 4dcb183af31d5cb33b6ef8e581e77d1c892a58b9 (diff) |
Added switch
Diffstat (limited to 'src/nix/bundle.cc')
-rw-r--r-- | src/nix/bundle.cc | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/nix/bundle.cc b/src/nix/bundle.cc index 2d0a0b6ea..c59018726 100644 --- a/src/nix/bundle.cc +++ b/src/nix/bundle.cc @@ -11,6 +11,7 @@ struct CmdBundle : InstallableCommand { std::string bundler = "github:matthewbauer/nix-bundle"; std::optional<Path> outLink; + bool skipReferenceCheck = false; CmdBundle() { @@ -32,6 +33,12 @@ struct CmdBundle : InstallableCommand .handler = {&outLink}, .completer = completePath }); + + addFlag({ + .longName = "skip-refcheck", + .description = "Skip checking of references in bundle.", + .handler = {&skipReferenceCheck, true}, + }); } std::string description() override @@ -117,7 +124,7 @@ struct CmdBundle : InstallableCommand auto outPathS = store->printStorePath(outPath); auto info = store->queryPathInfo(outPath); - if (!info->references.empty()) + if (!info->references.empty() && !skipReferenceCheck) throw Error("'%s' has references; a bundler must not leave any references", outPathS); if (!outLink) |