oleg-shilo / cs-script

C# scripting platform
http://www.cs-script.net
MIT License
1.57k stars 234 forks source link

cs-script 4.8.5 does not see cache directory on Linux #345

Closed shitpoet closed 8 months ago

shitpoet commented 8 months ago

cs-script 4.8.5 installed on Debian 12 Linux as

dotnet tool install --global cs-script.cli

doesn't see the cache directory:

~/tmp/cs$ css -cache:ls
Cache root: /tmp/csscript.core/Cache
Listing cache items:

~/tmp/cs$

because it looks for Cache directory (the first letter is Capitalized), but the real directory it creates is all in small letters - /tmp/csscript.core/cache

It sees the directory if I manually create symlink Cache -> cache:

~/tmp/cs$ css -cache:ls
Cache root: /tmp/csscript.core/Cache
Listing cache items:

-1032282138:    /home/ors/tmp/cs

~/tmp/cs$

Config is default:

~/tmp/cs$ css -config
 UseAlternativeCompiler: ""
 ResolveRelativeFromParentScriptLocation: False
 DefaultArguments: "-c -ac:0"
 InjectScriptAssemblyAttribute: False
 EnableDbgPrint: True
 ResolveAutogenFilesRefs: True
 LegacyNugetSupport: True
 OpenEndDirectiveSyntax: True
 ConsoleEncoding: "default"
 LegacyTimestampCaching: False
 CustomTempDirectory: ""
 DefaultCompilerEngine: "csc"
 DefaultRefAssemblies: "System; System.Core;"
 SearchDirs: "%CSSCRIPT_ROOT%/lib;;%CSSCRIPT_INC%;"
 Precompiler: ""
 CustomHashing: True
 ReportDetailedErrorInfo: False
 HideCompilerWarnings: False
 InMemoryAssembly: True
 ConcurrencyControl: Standard

No env variables are set for cs-script:

~/tmp/cs$ env | grep CSSCRIPT
~/tmp/cs$

Note: css without cache:ls does use the cache, so only the -cache switch doesn't see the cache directory.

Also please note that FS on Linux is usully case-sensitive.

oleg-shilo commented 8 months ago

Thank you. Yes it is a mistake. Will work on it right away

oleg-shilo commented 8 months ago

Done. It was a silly mistake in the code ported from the older codebase targeting Win. I will release the fix asap.

oleg-shilo commented 8 months ago

You can update your deployment with v4.8.6.0

shitpoet commented 8 months ago

Yes, now it works correctly)

~/tmp/cs$ css -cache:ls
Cache root: /tmp/csscript.core/cache
Listing cache items:

-1032282138:    /home/ors/tmp/cs