Skip to content

Commit

Permalink
Improve PackTool log output
Browse files Browse the repository at this point in the history
  • Loading branch information
TGEnigma committed Feb 16, 2018
1 parent 5ec46b6 commit e11dc20
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Source/PackTools/DDS3Pack/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public bool Execute( string[] args )
.Trim( Path.DirectorySeparatorChar )
.Replace( "\\", "/" );

Console.WriteLine( $"Adding/Replacing file: {filePath}" );
Console.WriteLine( $"Adding file: {filePath}" );

fs.AddFile( filePath, file, ConflictPolicy.ThrowError );
}
Expand Down
5 changes: 3 additions & 2 deletions Source/PackTools/LBPack/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,6 @@ public bool Execute( string[] args )
{
foreach ( string file in Directory.EnumerateFiles( inputPath, "*.*", SearchOption.AllDirectories ) )
{
Console.WriteLine( $"Adding file: {file}" );

var name = Path.GetFileNameWithoutExtension( file );
if ( name == null )
continue;
Expand All @@ -89,15 +87,18 @@ public bool Execute( string[] args )
{
if ( nameParts.Length > 1 && short.TryParse( nameParts[1], out var userId ) )
{
Console.WriteLine( $"Adding file: {file} as: {handle}:{userId}" );
fs.AddFile( handle, userId, file, ConflictPolicy.Replace );
}
else
{
Console.WriteLine( $"Adding file: {file} as: {handle}:0" );
fs.AddFile( handle, file, ConflictPolicy.Replace );
}
}
else
{
Console.WriteLine( $"Adding file: {file}" );
fs.AddFile( file );
}
}
Expand Down
10 changes: 9 additions & 1 deletion Source/PackTools/PAKPack/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,15 @@ public bool Execute( string[] args )
{
foreach ( string file in Directory.EnumerateFiles( inputPath, "*.*", SearchOption.AllDirectories ) )
{
Console.WriteLine( $"Adding {file}" );

pak.AddFile( file.Substring( inputPath.Length )
.Trim( Path.DirectorySeparatorChar )
.Replace( "\\", "/" ),
file, ConflictPolicy.Ignore );
}

Console.WriteLine( $"Saving..." );
pak.Save( outputPath );
}

Expand Down Expand Up @@ -155,13 +158,14 @@ public bool Execute( string[] args )

using ( pak )
{
Console.WriteLine( $"PAK format version: {Program.NameToFormat[pak.Version]}." );
Console.WriteLine( $"PAK format version: {Program.NameToFormat[pak.Version]}" );

foreach ( string file in pak.EnumerateFiles() )
{
using ( var stream = FileUtils.Create( outputPath + Path.DirectorySeparatorChar + file ) )
using ( var inputStream = pak.OpenFile( file ) )
{
Console.WriteLine( $"Extracting {file}" );
inputStream.CopyTo( stream );
}
}
Expand Down Expand Up @@ -211,12 +215,14 @@ public bool Execute( string[] args )
{
foreach ( string file in Directory.EnumerateFiles( directoryPath, "*.*", SearchOption.AllDirectories ) )
{
Console.WriteLine( $"Adding/Replacing {file}" );
pak.AddFile( file.Substring( directoryPath.Length )
.Trim( Path.DirectorySeparatorChar )
.Replace( "\\", "/" ),
file, ConflictPolicy.Replace );
}

Console.WriteLine( "Saving..." );
pak.Save( outputPath );
}
}
Expand Down Expand Up @@ -245,8 +251,10 @@ public bool Execute( string[] args )
return false;
}

Console.WriteLine( $"Adding/Replacing {entryName}" );
pak.AddFile( entryName, filePath, ConflictPolicy.Replace );

Console.WriteLine( "Saving..." );
pak.Save( outputPath );
}
}
Expand Down

0 comments on commit e11dc20

Please # to comment.