Skip to content

Commit e4f1d9e

Browse files
committed
Fix: extract /src folder as libs/<name> + /LICENSE + /shard.yml
1 parent 114987b commit e4f1d9e

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/resolvers/git.cr

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,16 @@ module Shards
3636
cleanup_install_directory
3737
Dir.mkdir(install_path)
3838

39-
run "git archive --format=tar #{refs} | tar x -C #{escape install_path}"
39+
if file_exists?(refs, SPEC_FILENAME)
40+
run "git archive --format=tar #{refs} #{SPEC_FILENAME} | tar x -C #{escape install_path}"
41+
end
42+
43+
# TODO: search for LICENSE* files
44+
if file_exists?(refs, "LICENSE")
45+
run "git archive --format=tar #{refs} 'LICENSE' | tar x -C #{escape install_path}"
46+
end
47+
48+
run "git archive --format=tar --prefix= #{refs}:src/ | tar x -C #{escape install_path}"
4049
end
4150

4251
def local_path

0 commit comments

Comments
 (0)