Merge eureka/aetheria-release-ships-addon-frame-r4: ships authoring tool and add-on frame
# Conflicts: # tests/Aetheria.Shared.Tests/ShipSchemaPinTests.cs
This commit is contained in:
commit
54ac0fcfa7
16 changed files with 1897 additions and 163 deletions
|
|
@ -19,15 +19,15 @@ public sealed class AetherDb
|
|||
catalogWritable: catalogWritable);
|
||||
}
|
||||
|
||||
// With no root given, walks up from the working directory to the repository
|
||||
// With no root given, walks up from the working directory to the game folder: the first folder whose GameData holds Aetheria.cc
|
||||
public static AetherDb Open(bool catalogWritable = false, bool withRun = false, string root = null) =>
|
||||
new AetherDb(root ?? FindRoot(), catalogWritable, withRun);
|
||||
|
||||
public static string FindRoot()
|
||||
{
|
||||
for (var dir = new DirectoryInfo(Environment.CurrentDirectory); dir != null; dir = dir.Parent)
|
||||
if (File.Exists(Path.Combine(dir.FullName, "Aetheria.Shared", "Aetheria.Shared.csproj")))
|
||||
if (File.Exists(Path.Combine(dir.FullName, "GameData", "Aetheria.cc")))
|
||||
return dir.FullName;
|
||||
throw new DirectoryNotFoundException("Run from inside the Aetheria repository.");
|
||||
throw new DirectoryNotFoundException("Run from a folder whose GameData holds Aetheria.cc.");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -46,6 +46,7 @@ public static class ShipAuthoringCommands
|
|||
}
|
||||
if (args[0] == "create" && (args.Length == 4 || args.Length == 6 && args[4] == "--like"))
|
||||
{
|
||||
ShipAuthoringStore.RequireShipId(args[2]);
|
||||
var path = Path.GetFullPath(args[1]);
|
||||
if (File.Exists(path)) throw new InvalidOperationException($"Refusing to replace {path}");
|
||||
Directory.CreateDirectory(Path.GetDirectoryName(path));
|
||||
|
|
|
|||
Loading…
Reference in a new issue