Skip to content
This repository was archived by the owner on Dec 18, 2017. It is now read-only.

Fix kpm commands install folder #1269

Merged
merged 1 commit into from
Feb 25, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -135,12 +135,22 @@ public static AppCommandsFolderRepository Create(string installPath)

public static AppCommandsFolderRepository CreateDefault()
{
// TODO: use Environment.GetFolderPath(Environment.SpecialFolder.UserProfile) when it's available on CoreCLR
var userProfileFolder = Environment.GetEnvironmentVariable("USERPROFILE");
if (string.IsNullOrEmpty(userProfileFolder))
{
userProfileFolder = Environment.GetEnvironmentVariable("HOME");
}
var binFolder = Path.Combine(userProfileFolder, "bin");

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add TODO comments?

// TODO: use Environment.GetFolderPath(Environment.SpecialFolder.UserProfile) when it's available on CoreCLR

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

if (string.IsNullOrEmpty(userProfileFolder))
{
throw new InvalidOperationException("Could not resolve the user profile folder path.");
}

var binFolder = Path.Combine(
userProfileFolder,
Runtime.Constants.DefaultLocalRuntimeHomeDir,
"bin");
Directory.CreateDirectory(binFolder);

return Create(binFolder);
Expand Down