1
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
2
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
7
namespace ICSharpCode.PackageManagement.Scripting
9
public class PackageInitializeScript : PackageScript
11
public PackageInitializeScript(IPackage package, IPackageScriptFileName fileName)
12
: base(package, fileName)
16
protected override void BeforeRun()
18
AddScriptDirectoryToEnvironmentPath();
21
void AddScriptDirectoryToEnvironmentPath()
23
if (ScriptFileName.ScriptDirectoryExists()) {
24
string directory = ScriptFileName.GetScriptDirectory();
25
AddScriptDirectoryToEnvironmentPath(directory);
29
void AddScriptDirectoryToEnvironmentPath(string directory)
31
var environmentPath = new PowerShellSessionEnvironmentPath(Session);
32
environmentPath.Append(directory);