-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Disc Support #3
base: main
Are you sure you want to change the base?
Conversation
Sorry, what issues? I was unable to figure out what the problem is |
Is the Disc Path supposed to be an optional argument? It looks that way, but the readme has it in the mandatory <> signs. |
It is an optional argument yeah, should I replace it with [ ]? |
If it's optional, then a system to have unordered arguments needs to be added as well, as -u [disc path] and [disc path] -u should both be valid because they are optional |
Hmmm yeah, I'll get to implementing that. |
Done! I've also made the optional argument parser a function in case anybody wants to add more optional arguments in the future. |
SyatiModuleBuildTool/Program.cs
Outdated
if (args.Length > 4 && args[4] != "-u") { // Make sure the argument in the position of Path_To_Disc_Output_Folder isn't the unibuild flag | ||
Console.WriteLine(); | ||
Console.WriteLine("Copying disc..."); | ||
// if (args.Length > 4 && args[4] != "-u") { // Make sure the argument in the position of Path_To_Disc_Output_Folder isn't the unibuild flag |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, left that in accidentally, I'll fix it rn
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First time ever writing a review lol.
Done! |
Hey actually, what happens if two modules provide the same file? There should probably be a warning about that... |
Currently the last file to be copied is the one that stays, but now that you mention it... |
I would actually prefer that it be handled properly instead of just being a warning, if possible. |
Yea, also not sure how to handle it. |
Added a simple warning when a file is overwritten. |
SyatiModuleBuildTool/DiscUtility.cs
Outdated
var targetPath = Path.Combine(output, relativePath); | ||
|
||
try { | ||
if (Path.Exists(targetPath)) | ||
Console.WriteLine($" - File will replace {targetPath}"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not understand this error. what file will replace targetPath?
SyatiModuleBuildTool/DiscUtility.cs
Outdated
var targetDirectory = Path.GetDirectoryName(targetPath); | ||
if (targetDirectory is not null) | ||
Directory.CreateDirectory(targetDirectory); | ||
|
||
File.Copy(sourcePath, targetPath, true); | ||
} | ||
catch (Exception e) { | ||
Console.WriteLine($"Error while copying \"{sourceDiscFolder}\": {e.Message}"); | ||
Console.WriteLine($"Error while copying {discFolder}: {e.Message}"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Restore the quotation marks please
Users can now input a path to output disc files of modules too.
This also makes a slight change to how the unibuild flag is checked, which prevents some issues.