-
-
Notifications
You must be signed in to change notification settings - Fork 345
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #292 from pjf/291_moduleinstaller_fixes
Bugfix: Make top-level components installable.
- Loading branch information
Showing
9 changed files
with
125 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
using System; | ||
using System.IO; | ||
|
||
namespace Tests | ||
{ | ||
/// <summary> | ||
/// A disposable KSP instance. Use the `.KSP` property to access, will | ||
/// be automatically cleaned up on DisposableKSP falling out of using() scope. | ||
/// </summary> | ||
public class DisposableKSP :IDisposable | ||
{ | ||
private readonly string good_ksp = Tests.TestData.good_ksp_dir(); | ||
private CKAN.KSP _ksp; | ||
private string disposable_dir; | ||
|
||
public CKAN.KSP KSP { | ||
get | ||
{ | ||
return _ksp; | ||
} | ||
} | ||
|
||
/// <summary> | ||
/// Creates a copy of the provided argument, or a known-good KSP install if passed null. | ||
/// Use .KSP to access the KSP object itself. | ||
/// </summary> | ||
public DisposableKSP(string directory_to_clone = null) | ||
{ | ||
directory_to_clone = directory_to_clone ?? good_ksp; | ||
disposable_dir = Tests.TestData.NewTempDir(); | ||
Tests.TestData.CopyDirectory(directory_to_clone, disposable_dir); | ||
_ksp = new CKAN.KSP(disposable_dir); | ||
} | ||
|
||
public void Dispose() | ||
{ | ||
Directory.Delete(disposable_dir, true); | ||
_ksp = null; // In case .Dispose() was called manually. | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"spec_version" : 1, | ||
"name" : "Module Manager", | ||
"identifier" : "ModuleManager", | ||
"abstract" : "Modify KSP configs without conflict", | ||
"download" : "https://ksp.sarbian.com/jenkins/job/ModuleManager/lastSuccessfulBuild/artifact/ModuleManager-2.5.1.zip", | ||
"license" : "CC-BY-SA", | ||
"author" : [ "ialdabaoth", "Sarbian" ], | ||
"version" : "2.5.1", | ||
"release_status" : "stable", | ||
"ksp_version" : "0.25", | ||
"install" : [ | ||
{ | ||
"file" : "ModuleManager.2.5.1.dll", | ||
"install_to" : "GameData" | ||
} | ||
] | ||
} |
Binary file not shown.