nix ls: support '/' for the root directory

This commit is contained in:
Benno Fünfstück 2017-05-15 10:18:27 +02:00
parent 510bc1735b
commit 06880d7ed8

View file

@ -61,6 +61,10 @@ struct MixLs : virtual Args
showFile(curPath, relPath);
};
if (path == "/") {
path = "";
}
auto st = accessor->stat(path);
if (st.type == FSAccessor::Type::tMissing)
throw Error(format("path %1% does not exist") % path);