The release and knowledge tools follow the house rules too
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01W4YtEJrgxG12Pc39Fai8Bd
This commit is contained in:
1 parent
7cad7a32dd
commit
b4bd102b17
2 files changed
+7
-2
No files matched your search
+1
-1
@@ -59,7 +59,7 @@ using (var input = File.OpenRead(download))
|
|||||||
using (var file = File.Create(Path.Combine(output, "ip2asn.bin")))
|
using (var file = File.Create(Path.Combine(output, "ip2asn.bin")))
|
||||||
AsnTable.Write(file, sourceDate, Sources.IpToAsn(input));
|
AsnTable.Write(file, sourceDate, Sources.IpToAsn(input));
|
||||||
foreach (var stale in new[] { "networks.bin", "carriers.json", "registry.bin" }) File.Delete(Path.Combine(output, stale));
|
foreach (var stale in new[] { "networks.bin", "carriers.json", "registry.bin" }) File.Delete(Path.Combine(output, stale));
|
||||||
string sha;
|
var sha = default(string);
|
||||||
using (var input = File.OpenRead(download)) sha = Convert.ToHexStringLower(SHA256.HashData(input));
|
using (var input = File.OpenRead(download)) sha = Convert.ToHexStringLower(SHA256.HashData(input));
|
||||||
File.WriteAllText(Path.Combine(output, "SOURCE.txt"), $"iptoasn.com, Public Domain Dedication and License (PDDL) 1.0\n{Fallback}\nlast-modified {sourceDate:O}\nsha256 {sha}\n");
|
File.WriteAllText(Path.Combine(output, "SOURCE.txt"), $"iptoasn.com, Public Domain Dedication and License (PDDL) 1.0\n{Fallback}\nlast-modified {sourceDate:O}\nsha256 {sha}\n");
|
||||||
Report();
|
Report();
|
||||||
|
|||||||
+6
-1
@@ -365,7 +365,7 @@ string Reset(string folder)
|
|||||||
return folder;
|
return folder;
|
||||||
}
|
}
|
||||||
|
|
||||||
string Size(string file) => $"{new FileInfo(file).Length / 1024.0 / 1024.0:0.0} MB";
|
string Size(string file) => $"{new FileInfo(file).Length.ToMegabytes()} MB";
|
||||||
|
|
||||||
string Option(string key)
|
string Option(string key)
|
||||||
{
|
{
|
||||||
@@ -404,3 +404,8 @@ static string FindRoot()
|
|||||||
while (dir is not null && !File.Exists(Path.Combine(dir.FullName, "MeWeb.slnx"))) dir = dir.Parent;
|
while (dir is not null && !File.Exists(Path.Combine(dir.FullName, "MeWeb.slnx"))) dir = dir.Parent;
|
||||||
return dir?.FullName ?? throw new InvalidOperationException("run from inside the repository (MeWeb.slnx not found)");
|
return dir?.FullName ?? throw new InvalidOperationException("run from inside the repository (MeWeb.slnx not found)");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static class NumbersExtensions
|
||||||
|
{
|
||||||
|
public static string ToMegabytes(this long bytes) => (bytes / 1048576.0).ToString("0.0", System.Globalization.CultureInfo.InvariantCulture);
|
||||||
|
}
|
||||||
Reference in new issue
Block a user