-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Directory Separator char was not handled properly in linux. (#709)
* Directory Separator char was not handled properly in linux. It fixes error with Shell function: The system cannot find the file specified. * Make StaticPhysicalPath return a path ending with DirectorySeparator char to keep compatibility. * Replace Path combine that changes the path to the root path. * Fix error with shell in Ubuntu. Executable delimiters are not supported and not needed. (cherry picked from commit 85fe332)
- Loading branch information
1 parent
d784c7d
commit e7da0a0
Showing
12 changed files
with
70 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
using System.IO; | ||
using GeneXus.Utils; | ||
using Xunit; | ||
|
||
namespace xUnitTesting | ||
{ | ||
|
||
public class ShellTest | ||
{ | ||
[Fact] | ||
public void ExecutableTest() | ||
{ | ||
string fileName = "hello.bat"; | ||
File.WriteAllText(fileName, "echo \"hello %1\""); | ||
int errorCode = GXUtil.Shell($"{fileName} test", 1, 1); | ||
Assert.Equal(0, errorCode); | ||
} | ||
[Fact] | ||
public void ExecutableWithSpacesTest() | ||
{ | ||
string fileName = "hello world.bat"; | ||
File.WriteAllText(fileName, "echo \"hello %1\""); | ||
int errorCode = GXUtil.Shell($"'{fileName}' test", 1, 1); | ||
Assert.Equal(0, errorCode); | ||
} | ||
|
||
[Fact] | ||
public void WorkingDirWithSpacesTest() | ||
{ | ||
string fileName = Path.Combine(Directory.GetCurrentDirectory(), "my dir", "hello world.bat"); | ||
FileInfo fi = new FileInfo(fileName); | ||
Directory.CreateDirectory(fi.DirectoryName); | ||
File.WriteAllText(fileName, "echo \"hello %1\""); | ||
int errorCode = GXUtil.Shell($"'{fileName}' test", 1, 1); | ||
Assert.Equal(0, errorCode); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters