diff --git a/source/dub/internal/utils.d b/source/dub/internal/utils.d index 5879e79..3c8a6e3 100644 --- a/source/dub/internal/utils.d +++ b/source/dub/internal/utils.d @@ -105,12 +105,6 @@ } } -bool isEmptyDir(NativePath p) { - foreach(DirEntry e; dirEntries(p.toNativeString(), SpanMode.shallow)) - return false; - return true; -} - bool isWritableDir(NativePath p, bool create_if_missing = false) { import std.random; @@ -163,17 +157,6 @@ throw new Exception("No package descriptor found"); } -Json jsonFromZip(NativePath zip, string filename) { - import std.zip : ZipArchive; - auto f = openFile(zip, FileMode.read); - ubyte[] b = new ubyte[cast(size_t)f.size]; - f.rawRead(b); - f.close(); - auto archive = new ZipArchive(b); - auto text = stripUTF8Bom(cast(string)archive.expand(archive.directory[filename])); - return parseJsonString(text, zip.toNativeString~"/"~filename); -} - void writeJsonFile(NativePath path, Json json) { auto f = openFile(path, FileMode.createTrunc); @@ -197,11 +180,6 @@ moveFile(tmppath, path); } -bool isPathFromZip(string p) { - enforce(p.length > 0); - return p[$-1] == '/'; -} - bool existsDirectory(NativePath path) { if( !existsFile(path) ) return false; auto fi = getFileInfo(path);