void ISubCommand.Run() { if (!System.IO.Directory.Exists(SrcPath)) { throw new Exception($"Directory {SrcPath} is not found."); } if (DstPath is null || DstPath == "") { throw new Exception($"Output '{DstPath}' is invalid."); } var dst = DstPath.EndsWith(".pack") ? DstPath : $"{DstPath}.pack"; if (Password is null) { if (!Engine.File.Pack(SrcPath, dst)) { throw new Exception($"Failed to pack '{SrcPath}' to '{dst}'."); } } else { if (!Engine.File.PackWithPassword(SrcPath, dst, Password)) { throw new Exception($"Failed to pack '{SrcPath}' to '{dst}' with password."); } } }
void ISubCommand.Run() { if (!System.IO.File.Exists(SrcPath)) { throw new Exception($"File {SrcPath} is not found."); } if (DstPath is null || DstPath == "") { throw new Exception($"Output '{DstPath}' is invalid."); } var dst = DstPath.EndsWith(".a2f") ? DstPath : $"{DstPath}.a2f"; if (!Font.GenerateFontFile(SrcPath, dst, Characters, SamplingSize)) { throw new Exception($"Failed to generate font file from '{SrcPath}' to '{dst}'"); } }