6 Commits e80608c609 ... 297eeb1bd2

Author SHA1 Message Date
  Matthias Beyer 297eeb1bd2 Merge pull request #992 from matthiasbeyer/remove-nix-deps 6 years ago
  Matthias Beyer f041fb3b18 Merge pull request #993 from matthiasbeyer/fix-dep-rustc-version 6 years ago
  Matthias Beyer cfaed077dc Update to rustc 1.17 6 years ago
  Matthias Beyer b4d0398333 Merge pull request #991 from matthiasbeyer/imag-link/export-consistency-check 6 years ago
  Matthias Beyer be38166bc7 Remove bundler 6 years ago
  Matthias Beyer 7ecef14e1b Export store-consistency-check from libimagentrylink in UI 6 years ago
4 changed files with 22 additions and 2 deletions
  1. 1 1
      .travis.yml
  2. 0 1
      default.nix
  3. 14 0
      imag-link/src/main.rs
  4. 7 0
      imag-link/src/ui.rs

+ 1 - 1
.travis.yml

@@ -14,7 +14,7 @@ rust:
 
 matrix:
   include:
-    - rust: 1.15.0
+    - rust: 1.17.0
   allow_failures:
     - rust: nightly
 

+ 0 - 1
default.nix

@@ -7,7 +7,6 @@ let
   ];
 
   dependencies = with pkgs; [
-    bundler
     cmake
     curl
     gcc

+ 14 - 0
imag-link/src/main.rs

@@ -84,10 +84,24 @@ fn main() {
 }
 
 fn handle_internal_linking(rt: &Runtime) {
+    use libimagentrylink::internal::store_check::StoreLinkConsistentExt;
 
     debug!("Handle internal linking call");
     let cmd = rt.cli().subcommand_matches("internal").unwrap();
 
+    if cmd.is_present("check-consistency") {
+        match rt.store().check_link_consistency() {
+            Ok(_) => {
+                info!("Store is consistent");
+                return;
+            }
+            Err(e) => {
+                trace_error(&e);
+                ::std::process::exit(1);
+            }
+        }
+    }
+
     match cmd.value_of("list") {
         Some(list) => handle_internal_linking_list_call(rt, cmd, list),
         None => {

+ 7 - 0
imag-link/src/ui.rs

@@ -78,6 +78,13 @@ pub fn build_ui<'a>(app: App<'a, 'a>) -> App<'a, 'a> {
                          .takes_value(false)
                          .required(false)
                          .help("If --list is provided, also list external links (debugging helper that might be removed at some point"))
+
+                    .arg(Arg::with_name("check-consistency")
+                         .long("check-consistency")
+                         .short("C")
+                         .takes_value(false)
+                         .required(false)
+                         .help("Check the link-consistency in the store (might be time-consuming)"))
                     )
         .subcommand(SubCommand::with_name("external")
                     .about("Add and remove external links")