forked from loic-sharma/BaGet
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Align AspNet versions; improve default experience
- Loading branch information
1 parent
9d60af7
commit c38a4bd
Showing
2 changed files
with
19 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,28 @@ | ||
using System.IO; | ||
using System.Collections.Generic; | ||
using System.ComponentModel.DataAnnotations; | ||
using System.IO; | ||
using System.Linq; | ||
|
||
namespace BaGet.Core.Configuration | ||
{ | ||
public class FileSystemStorageOptions : StorageOptions | ||
public class FileSystemStorageOptions : StorageOptions, IValidatableObject | ||
{ | ||
/// <summary> | ||
/// The path at which content will be stored. Defaults to the same path | ||
/// as the main BaGet executable. This path will be created if it does not | ||
/// exist at startup. Packages will be stored in a subfolder named "packages". | ||
/// </summary> | ||
public string Path { get; set; } = Directory.GetCurrentDirectory(); | ||
public string Path { get; set; } | ||
|
||
public IEnumerable<ValidationResult> Validate(ValidationContext validationContext) | ||
{ | ||
// Convert an empty storage path to the current working directory. | ||
if (string.IsNullOrEmpty(Path)) | ||
{ | ||
Path = Directory.GetCurrentDirectory(); | ||
} | ||
|
||
return Enumerable.Empty<ValidationResult>(); | ||
} | ||
} | ||
} |