2017-11-21 20:10:06 -08:00
|
|
|
|
// Copyright (c) .NET Foundation and contributors. All rights reserved.
|
|
|
|
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
|
|
|
|
|
|
|
|
using System.IO;
|
|
|
|
|
|
2017-12-04 14:13:24 -08:00
|
|
|
|
namespace Microsoft.DotNet.ToolPackage
|
2017-11-21 20:10:06 -08:00
|
|
|
|
{
|
|
|
|
|
internal class PackageVersion
|
|
|
|
|
{
|
|
|
|
|
public PackageVersion(string packageVersion)
|
|
|
|
|
{
|
|
|
|
|
if (packageVersion == null)
|
|
|
|
|
{
|
|
|
|
|
Value = Path.GetRandomFileName();
|
|
|
|
|
IsPlaceholder = true;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
Value = packageVersion;
|
|
|
|
|
IsPlaceholder = false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public bool IsPlaceholder { get; }
|
|
|
|
|
public string Value { get; }
|
|
|
|
|
public bool IsConcreteValue => !IsPlaceholder;
|
|
|
|
|
}
|
|
|
|
|
}
|