Skip to content

Commit

Permalink
Align AspNet versions; improve default experience
Browse files Browse the repository at this point in the history
  • Loading branch information
loic-sharma committed Dec 11, 2018
1 parent 9d60af7 commit c38a4bd
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/BaGet.AWS/BaGet.AWS.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netstandard2.0;net461</TargetFrameworks>
Expand All @@ -8,7 +8,7 @@

<ItemGroup>
<PackageReference Include="AWSSDK.S3" Version="3.3.30" />
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="2.1.1" />
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="2.2.0" />
</ItemGroup>

<ItemGroup>
Expand Down
20 changes: 17 additions & 3 deletions src/BaGet.Core/Configuration/FileSystemStorageOptions.cs
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>();
}
}
}

0 comments on commit c38a4bd

Please sign in to comment.