File tree Expand file tree Collapse file tree 4 files changed +17
-3
lines changed
Expand file tree Collapse file tree 4 files changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,8 @@ class Add < Base
2121 attr_reader :skip_src_check
2222
2323 def run
24+ say "Performing git operations, this may take a while...\n " if lib_source . git?
25+
2426 if args [ '--list' ]
2527 show_list
2628 else
Original file line number Diff line number Diff line change @@ -47,8 +47,8 @@ def path
4747
4848 def git_clone
4949 dir = Dir . mktmpdir 'bashly-libs-'
50- safe_run "git clone --depth 1 #{ git_specs [ :url ] } #{ dir } "
51- safe_run %[git -C "#{ dir } " checkout #{ git_specs [ :ref ] } ] if git_specs [ :ref ]
50+ safe_run "git clone --quiet #{ git_specs [ :url ] } #{ dir } "
51+ safe_run %[git -C "#{ dir } " checkout --quiet #{ git_specs [ :ref ] } ] if git_specs [ :ref ]
5252
5353 "#{ dir } #{ git_specs [ :path ] } "
5454 end
@@ -69,7 +69,7 @@ def git_specs
6969 end
7070
7171 def safe_run ( cmd )
72- raise "Failed running command:\n m`#{ cmd } `" unless system " #{ cmd } > /dev/null 2>&1"
72+ raise "Failed running command:\n m`#{ cmd } `" unless system cmd
7373 end
7474
7575 def transform_github_uri
Original file line number Diff line number Diff line change 1+ Performing git operations, this may take a while...
2+
3+ created spec/tmp/src/lib/database.sh
Original file line number Diff line number Diff line change 200200 . to output_approval ( 'cli/add/from-extenal-path' )
201201 end
202202 end
203+
204+ context 'with a library from github' do
205+ before { reset_tmp_dir create_src : true }
206+
207+ it 'properly installs the library' do
208+ expect { subject . execute %w[ add --source github:dannyben/bashly//spec/fixtures/libraries database ] }
209+ . to output_approval ( 'cli/add/from-github' )
210+ end
211+ end
203212end
You can’t perform that action at this time.
0 commit comments