You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
978 B
37 lines
978 B
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt) |
|
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) |
|
|
|
using System; |
|
using NuGet; |
|
|
|
namespace ICSharpCode.PackageManagement.Scripting |
|
{ |
|
public class PackageInitializeScript : PackageScript |
|
{ |
|
public PackageInitializeScript( |
|
IPackageScriptFileName fileName, |
|
IPackageScriptSession session) |
|
: base(fileName, session) |
|
{ |
|
} |
|
|
|
protected override void BeforeExecute() |
|
{ |
|
AddScriptDirectoryToEnvironmentPath(); |
|
} |
|
|
|
void AddScriptDirectoryToEnvironmentPath() |
|
{ |
|
if (ScriptFileName.ScriptDirectoryExists()) { |
|
string directory = ScriptFileName.GetScriptDirectory(); |
|
AddScriptDirectoryToEnvironmentPath(directory); |
|
} |
|
} |
|
|
|
void AddScriptDirectoryToEnvironmentPath(string directory) |
|
{ |
|
var environmentPath = new PowerShellSessionEnvironmentPath(Session); |
|
environmentPath.Append(directory); |
|
} |
|
} |
|
}
|
|
|