Skip to content

Commit bcc5393

Browse files
committed
Quiet git commands
1 parent a8e7f7b commit bcc5393

File tree

1 file changed

+27
-7
lines changed

1 file changed

+27
-7
lines changed

pkg.pl

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
:- module(pkg, [pkg_install/0]).
44

55
:- use_module(library(os)).
6+
:- use_module(library(pio)).
67
:- use_module(library(files)).
78
:- use_module(library(lists)).
89
:- use_module(library(format)).
@@ -46,6 +47,7 @@
4647
; make_directory_path("scryer_libs")
4748
),
4849
setenv("SHELL", "/bin/sh"),
50+
setenv("GIT_ADVICE", "0"),
4951
( member(dependencies(Deps), Manifest) ->
5052
ensure_dependencies(Deps)
5153
; true
@@ -57,16 +59,34 @@
5759
ensure_dependencies(Ds).
5860

5961
ensure_dependency(GitTerm) :-
60-
shell("rm -rf scryer_libs/tmp"),
62+
current_output(Out),
63+
phrase_to_stream(("Ensuring is installed: ", portray_clause_(GitTerm)), Out),
64+
shell("rm --recursive --force scryer_libs/tmp"),
6165
% Hell yeah, injection attack!
62-
git_command(GitTerm, GitCommand),
63-
append(GitCommand, Command),
66+
git_command(GitTerm, Command),
6467
shell(Command),
6568
parse_manifest("scryer_libs/tmp/scryer-manifest.pl", Manifest),
6669
member(name(Name), Manifest),
67-
append(["rm -rf scryer_libs/", Name, "; mv scryer_libs/tmp scryer_libs/", Name], Command2),
70+
append(
71+
[
72+
"rm --recursive --force scryer_libs/", Name,
73+
"; mv scryer_libs/tmp scryer_libs/", Name
74+
],
75+
Command2
76+
),
6877
shell(Command2).
6978

70-
git_command(git(Url), ["git clone --depth 1 --single-branch ", Url, " scryer_libs/tmp"]).
71-
git_command(git(Url, branch(Branch)), ["git clone --depth 1 --single-branch --branch ", Branch, " ", Url, " scryer_libs/tmp"]).
72-
git_command(git(Url, tag(Tag)), GitCommand) :- git_command(git(Url, branch(Tag)), GitCommand).
79+
git_command(git(Url), Command) :-
80+
Segments = ["git clone --quiet --depth 1 --single-branch ", Url, " scryer_libs/tmp"],
81+
append(Segments, Command).
82+
83+
git_command(git(Url, branch(Branch)), Command) :-
84+
Segments = [
85+
"git clone --quiet --depth 1 --single-branch --branch ",
86+
Branch, " ", Url,
87+
" scryer_libs/tmp"
88+
],
89+
append(Segments, Command).
90+
91+
git_command(git(Url, tag(Tag)), Command) :-
92+
git_command(git(Url, branch(Tag)), Command).

0 commit comments

Comments
 (0)