|
3 | 3 | :- module(pkg, [pkg_install/0]). |
4 | 4 |
|
5 | 5 | :- use_module(library(os)). |
| 6 | +:- use_module(library(pio)). |
6 | 7 | :- use_module(library(files)). |
7 | 8 | :- use_module(library(lists)). |
8 | 9 | :- use_module(library(format)). |
|
46 | 47 | ; make_directory_path("scryer_libs") |
47 | 48 | ), |
48 | 49 | setenv("SHELL", "/bin/sh"), |
| 50 | + setenv("GIT_ADVICE", "0"), |
49 | 51 | ( member(dependencies(Deps), Manifest) -> |
50 | 52 | ensure_dependencies(Deps) |
51 | 53 | ; true |
|
57 | 59 | ensure_dependencies(Ds). |
58 | 60 |
|
59 | 61 | 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"), |
61 | 65 | % Hell yeah, injection attack! |
62 | | - git_command(GitTerm, GitCommand), |
63 | | - append(GitCommand, Command), |
| 66 | + git_command(GitTerm, Command), |
64 | 67 | shell(Command), |
65 | 68 | parse_manifest("scryer_libs/tmp/scryer-manifest.pl", Manifest), |
66 | 69 | 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 | + ), |
68 | 77 | shell(Command2). |
69 | 78 |
|
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