Skip to content

Commit 56b4f6c

Browse files
committed
feat: Simpler way of launching SharpShell.Loader (from T:\ drive) - thx @ox
1 parent bcaedac commit 56b4f6c

File tree

4 files changed

+10
-50
lines changed

4 files changed

+10
-50
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ jobs:
3232
mkdir release\pwsh
3333
xcopy README.md release\
3434
xcopy pwsh.bat release\
35-
xcopy run_pwsh.xml release\pwsh\
3635
xcopy SharpShell.Loader\bin\Debug\net6.0\SharpShell.Loader.dll release\pwsh\
36+
xcopy SharpShell.Loader\bin\Debug\net6.0\SharpShell.Loader.runtimeconfig.json release\pwsh\
3737
3838
7z a -tzip SharpShell.zip .\release\*
3939

SharpShell.Loader/Program.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ internal class Program
88
{
99
// See generate_embedded.py
1010
private static readonly string[] BlacklistedDependencies = ["System.Management.Automation"];
11+
private static readonly string rootPath = Environment.GetEnvironmentVariable("PWSH_ROOT_PATH")
12+
?? throw new Exception("No PWSH_ROOT_PATH env variable found!");
1113

1214
static void Main(string[] args)
1315
{
@@ -25,7 +27,7 @@ static void Main(string[] args)
2527
return AssemblyLoadContext.Default.LoadFromStream(ms);
2628
}
2729

28-
var dllLocalPath = Path.Combine(Directory.GetCurrentDirectory(), name + ".dll");
30+
var dllLocalPath = Path.Combine(rootPath, name + ".dll");
2931
if (BlacklistedDependencies.Contains(name))
3032
return AssemblyLoadContext.Default.LoadFromAssemblyPath(dllLocalPath);
3133

pwsh.bat

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
@echo off
22

33
set DOTNET_CLI_TELEMETRY_OPTOUT=1
4-
cd /d D:\pwsh
5-
..\dotnet\dotnet.exe msbuild .\run_pwsh.xml -p:CommandLineArgs="%*"
4+
set PWSH_ROOT_PATH=D:\pwsh
5+
set DOTNET_ROOT_PATH=D:\dotnet
6+
7+
copy %PWSH_ROOT_PATH%\SharpShell.Loader.dll T:\SharpShell.Loader.dll >NUL
8+
copy %PWSH_ROOT_PATH%\SharpShell.Loader.runtimeconfig.json T:\SharpShell.Loader.runtimeconfig.json >NUL
9+
%DOTNET_ROOT_PATH%\dotnet.exe T:\SharpShell.Loader.dll %*

run_pwsh.xml

Lines changed: 0 additions & 46 deletions
This file was deleted.

0 commit comments

Comments
 (0)