Skip to content

Commit fe4c19f

Browse files
committed
Release v4.9.2
### CLI - Added new custom commands: - `css -pkill <process name pattern>`: terminates the process based on name. - `css -update`: updates already installed CS-Script (if detected) - `css -edit <script|custom command>`: opens the script in the default editor * Improved dev experience for `css -new:cmd <name>`: - Now name can include dash as a prefix. - Handle the case when during command creation with `-new:cmd` the file name is a command that starts with two dashes (e.g. -ver vs --version)handle ### CSScriptLib - no changes
1 parent fbc2a46 commit fe4c19f

File tree

16 files changed

+85
-36
lines changed

16 files changed

+85
-36
lines changed

help.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
C# Script execution engine (.NET Core). Version 4.9.1.0.
1+
C# Script execution engine (.NET Core). Version 4.9.2.0.
22
Copyright (C) 2004-2023 Oleg Shilo.
33

44
Usage: cscs <switch 1> <switch 2> <file> [params] [//x]
@@ -167,7 +167,7 @@ params Specifies optional parameters for a script file to be run.
167167
cscs -new:console console.cs
168168
cscs -new:winform myapp.cs
169169
cscs -new:wpf hello
170-
cscs -new:cmd edit
170+
cscs -new:cmd -edit
171171

172172
-code[:show] <script code>
173173
Executes script code directly without using a script file.

src/CSScriptLib/src/CSScriptLib/CSScriptLib.csproj

+12-6
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
1515
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
1616
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
17-
<Version>4.9.1</Version>
17+
<Version>4.9.2</Version>
1818
<Authors>Oleg Shilo</Authors>
1919
<Description>CS-Script engine Class Library for .NET 5 (and higher)</Description>
2020
<Copyright>(C) 2018-2023 Oleg Shilo</Copyright>
@@ -30,16 +30,22 @@
3030

3131
### CLI
3232

33-
- Added support for versioning of custom commands during `css -new:cmd ...`
34-
- Added custom command `-unlock`
33+
- Added new custom commands:
34+
- `css -pkill &lt;process name pattern&gt;`: terminates the process based on name.
35+
- `css -update`: updates already installed CS-Script (if detected)
36+
- `css -edit &lt;script|custom command&gt;`: opens the script in the default editor
37+
38+
* Improved dev experience for `css -new:cmd &lt;name&gt;`:
39+
- Now name can include dash as a prefix.
40+
- Handle the case when during command creation with `-new:cmd` the file name is a command that starts with two dashes (e.g. -ver vs --version)handle
3541

3642
### CSScriptLib
3743

3844
- no changes</PackageReleaseNotes>
3945
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
40-
<AssemblyVersion>4.9.1</AssemblyVersion>
41-
<FileVersion>4.9.1</FileVersion>
42-
<PackageVersion>4.9.1</PackageVersion>
46+
<AssemblyVersion>4.9.2</AssemblyVersion>
47+
<FileVersion>4.9.2</FileVersion>
48+
<PackageVersion>4.9.2</PackageVersion>
4349
<PackageLicenseExpression>MIT</PackageLicenseExpression>
4450
<PackageIcon>css_logo.png</PackageIcon>
4551
<SignAssembly>True</SignAssembly>

src/Tests.cscs/cli.cs

+18
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,23 @@ public void new_console()
203203
Assert.Equal("Compile: OK", output);
204204
}
205205

206+
[Fact]
207+
public void new_cmd()
208+
{
209+
var output = cscs_run($"-new:cmd ttt");
210+
var script_file = output.Replace("Created:", "").Trim();
211+
212+
try
213+
{
214+
Assert.Equal("-run.cs", script_file.GetFileName());
215+
Assert.Equal("-ttt", script_file.GetDirName().GetFileName());
216+
}
217+
finally
218+
{
219+
script_file.GetDirName().DeleteDir(true);
220+
}
221+
}
222+
206223
[Fact]
207224
public void syntax_version_10()
208225
{
@@ -383,6 +400,7 @@ static void Main()
383400
[Fact]
384401
public void compiler_output()
385402
{
403+
// Debugger.Break();
386404
var script_file = nameof(compiler_output);
387405
var output = cscs_run($"-new {script_file}");
388406

src/chocolatey/cs-script.nuspec

+9-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
33
<metadata>
44
<id>cs-script</id>
5-
<version>4.9.1</version>
5+
<version>4.9.2</version>
66
<title>CS-Script</title>
77
<authors>Oleg Shilo</authors>
88
<owners>Oleg Shilo</owners>
@@ -30,8 +30,14 @@
3030

3131
### CLI
3232

33-
- Added support for versioning of custom commands during `css -new:cmd ...`
34-
- Added custom command `-unlock`
33+
- Added new custom commands:
34+
- `css -pkill &lt;process name pattern&gt;`: terminates the process based on name.
35+
- `css -update`: updates already installed CS-Script (if detected)
36+
- `css -edit &lt;script|custom command&gt;`: opens the script in the default editor
37+
38+
* Improved dev experience for `css -new:cmd &lt;name&gt;`:
39+
- Now name can include dash as a prefix.
40+
- Handle the case when during command creation with `-new:cmd` the file name is a command that starts with two dashes (e.g. -ver vs --version)handle
3541

3642
### CSScriptLib
3743

src/cscs/cscs.csproj

+11-5
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<AssemblyName>cscs</AssemblyName>
77
<RootNamespace>CSScripting</RootNamespace>
88
<StartupObject />
9-
<Version>4.9.1</Version>
9+
<Version>4.9.2</Version>
1010
<Authors>Oleg Shilo</Authors>
1111
<Product>CS-Script</Product>
1212
<Copyright>(C) 2004-2023 Oleg Shilo</Copyright>
@@ -16,16 +16,22 @@
1616
<RepositoryUrl>https://github.com/oleg-shilo/cs-script</RepositoryUrl>
1717
<RepositoryType>git</RepositoryType>
1818
<PackageTags>C# script dynamic</PackageTags>
19-
<AssemblyVersion>4.9.1</AssemblyVersion>
20-
<FileVersion>4.9.1</FileVersion>
19+
<AssemblyVersion>4.9.2</AssemblyVersion>
20+
<FileVersion>4.9.2</FileVersion>
2121
<PackageReleaseNotes>---
2222

2323
## Changes
2424

2525
### CLI
2626

27-
- Added support for versioning of custom commands during `css -new:cmd ...`
28-
- Added custom command `-unlock`
27+
- Added new custom commands:
28+
- `css -pkill &lt;process name pattern&gt;`: terminates the process based on name.
29+
- `css -update`: updates already installed CS-Script (if detected)
30+
- `css -edit &lt;script|custom command&gt;`: opens the script in the default editor
31+
32+
* Improved dev experience for `css -new:cmd &lt;name&gt;`:
33+
- Now name can include dash as a prefix.
34+
- Handle the case when during command creation with `-new:cmd` the file name is a command that starts with two dashes (e.g. -ver vs --version)handle
2935

3036
### CSScriptLib
3137

src/cscs/csscript.cli.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ public void Sample(string appType, string outFile)
138138
{
139139
if (outFile.IsNotEmpty())
140140
{
141-
if (!outFile.StartsWith("-"))
141+
if (appType == "cmd" && !outFile.StartsWith("-"))
142142
outFile = "-" + outFile;
143143

144144
if (appType == "cmd" && outFile.GetDirName().IsEmpty())

src/cscs/csscript.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,8 @@ void copy_config(string name)
103103
}
104104
catch
105105
{
106-
print($"Error: you need to set environment variable '{envarName}' to the valid path to the Visual Studio executable devenv.exe.");
106+
print($"Error: you need to set environment variable '{envarName}' to the valid path to the Visual Studio executable devenv.exe.\n" +
107+
$"You can do ite either manually or by executing `css -vs:init`");
107108
}
108109
}
109110
else

src/css/Properties/AssemblyInfo.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,5 @@
3131
// You can specify all the values or you can default the Build and Revision Numbers
3232
// by using the '*' as shown below:
3333
// [assembly: AssemblyVersion("1.0.*")]
34-
[assembly: AssemblyVersion("4.9.1")]
35-
[assembly: AssemblyFileVersion("4.9.1")]
34+
[assembly: AssemblyVersion("4.9.2")]
35+
[assembly: AssemblyFileVersion("4.9.2")]

src/csws/csws.csproj

+11-5
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<UseWindowsForms>true</UseWindowsForms>
99
<RootNamespace>CSScripting</RootNamespace>
1010
<StartupObject />
11-
<Version>4.9.1</Version>
11+
<Version>4.9.2</Version>
1212
<Authors>Oleg Shilo</Authors>
1313
<Product>CS-Script</Product>
1414
<Copyright>(C) 2004-2022 Oleg Shilo</Copyright>
@@ -19,16 +19,22 @@
1919
<RepositoryUrl>https://github.com/oleg-shilo/cs-script</RepositoryUrl>
2020
<RepositoryType>git</RepositoryType>
2121
<PackageTags>C# script dynamic</PackageTags>
22-
<AssemblyVersion>4.9.1</AssemblyVersion>
23-
<FileVersion>4.9.1</FileVersion>
22+
<AssemblyVersion>4.9.2</AssemblyVersion>
23+
<FileVersion>4.9.2</FileVersion>
2424
<PackageReleaseNotes>---
2525

2626
## Changes
2727

2828
### CLI
2929

30-
- Added support for versioning of custom commands during `css -new:cmd ...`
31-
- Added custom command `-unlock`
30+
- Added new custom commands:
31+
- `css -pkill &lt;process name pattern&gt;`: terminates the process based on name.
32+
- `css -update`: updates already installed CS-Script (if detected)
33+
- `css -edit &lt;script|custom command&gt;`: opens the script in the default editor
34+
35+
* Improved dev experience for `css -new:cmd &lt;name&gt;`:
36+
- Now name can include dash as a prefix.
37+
- Handle the case when during command creation with `-new:cmd` the file name is a command that starts with two dashes (e.g. -ver vs --version)handle
3238

3339
### CSScriptLib
3440

src/out/Windows/-unlock/-run.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
var thisScript = GetEnvironmentVariable("EntryScript");
1111

12-
var help = $@"CS-Script custom command for checking and unlocking a locked file or a directory.
12+
var help = $@"Custom command for checking and unlocking a locked file or a directory.
1313
v{thisScript.GetCommandScriptVersion()} ({thisScript})
1414
1515
css -unlock <path>";

src/out/static_content/-pkill/-run.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
WriteLine("Enter: ");
5353
WriteLine(" - the index of the process to terminate");
5454
WriteLine(" - 'A' to terminate all");
55-
WriteLine(" - 'N' to exit");
55+
WriteLine(" - 'X' to exit");
5656

5757
var input = ReadLine();
5858
if (int.TryParse(input, out int index))
@@ -62,7 +62,7 @@
6262
try { matches[index].Kill(); }
6363
catch { }
6464
}
65-
else if (input.ToLower() == "n")
65+
else if (input.ToLower() == "x")
6666
{
6767
// do nothing
6868
}

src/out/static_content/-self/-edit/-run.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
var thisScript = GetEnvironmentVariable("EntryScript");
1010

1111
var help =
12-
@$"CS-Script custom command for editing scripts.
12+
@$"Custom command for editing scripts.
1313
v{thisScript.GetCommandScriptVersion()} ({thisScript})
1414
cscs -edit [args]
1515
(e.g. `cscs -edit script.cs`)";

src/out/static_content/-self/-update/-run.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
var thisScript = GetEnvironmentVariable("EntryScript");
1111

1212
var help =
13-
@$"CS-Script custom command for updating the installed CS-Script.
13+
@$"Custom command for updating the installed CS-Script.
1414
v{thisScript.GetCommandScriptVersion()} ({thisScript})
1515
css -self-update [args]
1616
(e.g. `css -self-update test.txt`)";
@@ -203,4 +203,4 @@ void HandleInput(Process process)
203203
catch
204204
{
205205
}
206-
}
206+
}

src/out/static_content/-unlock/-run.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
var thisScript = GetEnvironmentVariable("EntryScript");
1111

12-
var help = $@"CS-Script custom command for checking and unlocking a locked file or a directory.
12+
var help = $@"Custom command for checking and unlocking a locked file or a directory.
1313
v{thisScript.GetCommandScriptVersion()} ({thisScript})
1414
1515
css -unlock <path>";

src/out/static_content/-web/-run.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
var derfaultUrl = $"http://localhost:{ThisOrNextAvailable(5050)}";
1313

14-
var help = $@"CS-Script custom command for starting a Web server for servicing static files.
14+
var help = $@"Custom command for starting a Web server for servicing static files.
1515
v{GetVersion()} ({Environment.GetEnvironmentVariable("EntryScript")})
1616
1717
css -web [web content folder] [-url:<url>]

src/release_notes.md

+9-3
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,19 @@
1-
# Release v4.9.1
1+
# Release v4.9.2
22

33
---
44

55
## Changes
66

77
### CLI
88

9-
- Added support for versioning of custom commands during `css -new:cmd ...`
10-
- Added custom command `-unlock`
9+
- Added new custom commands:
10+
- `css -pkill <process name pattern>`: terminates the process based on name.
11+
- `css -update`: updates already installed CS-Script (if detected)
12+
- `css -edit <script|custom command>`: opens the script in the default editor
13+
14+
* Improved dev experience for `css -new:cmd <name>`:
15+
- Now name can include dash as a prefix.
16+
- Handle the case when during command creation with `-new:cmd` the file name is a command that starts with two dashes (e.g. -ver vs --version)handle
1117

1218
### CSScriptLib
1319

0 commit comments

Comments
 (0)