builtins.fetchgit: Support paths
This commit is contained in:
parent
fbf17f1ad7
commit
ffcf9d24a6
1 changed files with 5 additions and 3 deletions
|
@ -58,9 +58,11 @@ static void prim_fetchgit(EvalState & state, const Pos & pos, Value * * args, Va
|
||||||
|
|
||||||
for (auto & attr : *args[0]->attrs) {
|
for (auto & attr : *args[0]->attrs) {
|
||||||
string name(attr.name);
|
string name(attr.name);
|
||||||
if (name == "url")
|
if (name == "url") {
|
||||||
url = state.forceStringNoCtx(*attr.value, *attr.pos);
|
PathSet context;
|
||||||
else if (name == "rev")
|
url = state.coerceToString(*attr.pos, *attr.value, context, false, false);
|
||||||
|
if (hasPrefix(url, "/")) url = "file://" + url;
|
||||||
|
} else if (name == "rev")
|
||||||
rev = state.forceStringNoCtx(*attr.value, *attr.pos);
|
rev = state.forceStringNoCtx(*attr.value, *attr.pos);
|
||||||
else
|
else
|
||||||
throw EvalError("unsupported argument ‘%s’ to ‘fetchgit’, at %s", attr.name, *attr.pos);
|
throw EvalError("unsupported argument ‘%s’ to ‘fetchgit’, at %s", attr.name, *attr.pos);
|
||||||
|
|
Loading…
Reference in a new issue