From 890104ab2e47ca964cd49fb13db7c58f4329e16c Mon Sep 17 00:00:00 2001 From: Bruno Pinto Date: Sun, 6 Sep 2015 01:55:52 +0100 Subject: [PATCH] Extract git clone calls into `omf.repo.clone` --- pkg/omf/cli/omf.install.fish | 4 ++-- pkg/omf/cli/omf.repo.clone.fish | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 pkg/omf/cli/omf.repo.clone.fish diff --git a/pkg/omf/cli/omf.install.fish b/pkg/omf/cli/omf.install.fish index 5696152..c268dd8 100644 --- a/pkg/omf/cli/omf.install.fish +++ b/pkg/omf/cli/omf.install.fish @@ -28,7 +28,7 @@ function omf.install -a type_flag name_or_url echo (omf::err)"Error: $local_name $install_type already installed."(omf::off) 1^&2 else echo (omf::dim)"Trying to clone from URL..."(omf::off) - if git clone -q $name_or_url $OMF_PATH/$parent_path/$local_name + if omf.repo.clone $name_or_url $OMF_PATH/$parent_path/$local_name omf.persist $install_type $name_or_url _display_success "$install_type $name_or_url" else @@ -46,7 +46,7 @@ function omf.install -a type_flag name_or_url echo (omf::em)"✔ $name_or_url $install_type up to date."(omf::off) else echo (omf::dim)"Installing $name_or_url $install_type..."(omf::off) - if git clone (cat $OMF_PATH/db/$target) $OMF_PATH/$target >/dev/null ^&1 + if omf.repo.clone (cat $OMF_PATH/db/$target) $OMF_PATH/$target omf.persist $install_type $name_or_url _display_success "$install_type $name_or_url" else diff --git a/pkg/omf/cli/omf.repo.clone.fish b/pkg/omf/cli/omf.repo.clone.fish new file mode 100644 index 0000000..2a2d9ef --- /dev/null +++ b/pkg/omf/cli/omf.repo.clone.fish @@ -0,0 +1,3 @@ +function omf.repo.clone -a url path + command git clone --quiet $url $path +end