Skip to content

Commit

Permalink
Added directory creation before compiling, corrected file names
Browse files Browse the repository at this point in the history
  • Loading branch information
Neskol committed Jan 18, 2024
1 parent 74513d4 commit 8909576
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 6 deletions.
2 changes: 2 additions & 0 deletions Commands/CompileMa2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ public override int Run(string[] remainingArguments)
if (Destination != null && !Destination.Equals(""))
{
string targetMaidataLocation = $"{Destination}/maidata.txt";
if (!Directory.Exists(Destination)) Directory.CreateDirectory(Destination);
StreamWriter sw = new StreamWriter(targetMaidataLocation, false);
{
sw.WriteLine(result);
Expand Down Expand Up @@ -127,6 +128,7 @@ public override int Run(string[] remainingArguments)
if (Destination != null && !Destination.Equals(""))
{
string targetMaidataLocation = $"{Destination}/result.ma2";
if (!Directory.Exists(Destination)) Directory.CreateDirectory(Destination);
StreamWriter sw = new StreamWriter(targetMaidataLocation, false);
{
sw.WriteLine(result);
Expand Down
7 changes: 4 additions & 3 deletions Commands/CompileMa2ID.cs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public override int Run(string[] remainingArguments)
string compensatedId =
Program.CompensateZero(ID ?? throw new NullReferenceException("ID shall not be null"));
Chart candidate = parser.ChartOfToken(tokenizer.Tokens(
$"{tokenLocation}music/music{compensatedId}/{compensatedId}_0{Difficulty}.ma2"));
$"{tokenLocation}/music/music{compensatedId}/{compensatedId}_0{Difficulty}.ma2"));
if (Rotate != null)
{
bool rotationIsValid = Enum.TryParse(Rotate, out NoteEnum.FlipMethod rotateMethod);
Expand All @@ -123,6 +123,7 @@ public override int Run(string[] remainingArguments)
if (Destination != null && !Destination.Equals(""))
{
string targetMaidataLocation = $"{Destination}/maidata.txt";
if (!Directory.Exists(Destination)) Directory.CreateDirectory(Destination);
StreamWriter sw = new StreamWriter(targetMaidataLocation, false);
{
sw.WriteLine(result);
Expand Down Expand Up @@ -156,6 +157,7 @@ public override int Run(string[] remainingArguments)
if (Destination != null && !Destination.Equals(""))
{
string targetMaidataLocation = $"{Destination}/result.ma2";
if (!Directory.Exists(Destination)) Directory.CreateDirectory(Destination);
StreamWriter sw = new StreamWriter(targetMaidataLocation, false);
{
sw.WriteLine(result);
Expand All @@ -171,7 +173,6 @@ public override int Run(string[] remainingArguments)
}
}
else Console.WriteLine(result);

break;
}

Expand All @@ -187,4 +188,4 @@ public override int Run(string[] remainingArguments)
}
}
}
}
}
2 changes: 2 additions & 0 deletions Commands/ComposeSimai.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ public override int Run(string[] remainingArguments)
if (Destination is not null && !Destination.Equals(""))
{
string targetMaidataLocation = $"{Destination}/maidata.txt";
if (!Directory.Exists(Destination)) Directory.CreateDirectory(Destination);
StreamWriter sw = new StreamWriter(targetMaidataLocation, false);
{
sw.WriteLine(result);
Expand Down Expand Up @@ -133,6 +134,7 @@ public override int Run(string[] remainingArguments)
if (Destination != null && !Destination.Equals(""))
{
string targetMaidataLocation = $"{Destination}/result.ma2";
if (!Directory.Exists(Destination)) Directory.CreateDirectory(Destination);
StreamWriter sw = new StreamWriter(targetMaidataLocation, false);
{
sw.WriteLine(result);
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
### Usage & Available Commands
> Type 'MaichartConverter help' for detailed manual for each command.
- [`CompileDatabase`](./Commands/Manuals/CompileDatabase.md): Compose whole ma2 database to simai
- [`ComposeMa2`](./Commands/Manuals/ComposeMa2.md): Compile assigned Ma2 chart to assigned format
- [`ComposeMa2ID`](./Commands/Manuals/ComposeMa2ID.md): Compile assigned Ma2 chart indexed by ID to assigned format
- [`ComposeSimai`](./Commands/Manuals/ComposeSimai.md): Compile assigned simai chart to assigned format
- [`CompileMa2`](./Commands/Manuals/CompileMa2.md): Compile assigned Ma2 chart to assigned format
- [`CompileMa2ID`](./Commands/Manuals/CompileMa2ID.md): Compile assigned Ma2 chart indexed by ID to assigned format
- [`CompileSimai`](./Commands/Manuals/CompileSimai.md): Compile assigned simai chart to assigned format
- [`ReverseMa2FromSimaiDatabase`](./Commands/Manuals/ReverseMa2FromSimaiDatabase.md): Reverse Simai Database from given folder to MaiAnalysis folder for compilation

### Parameters notice
Expand Down

0 comments on commit 8909576

Please sign in to comment.