forked from kodlamaio-projects/nArchitecture.Gen
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request kodlamaio-projects#3 from klc00/main
Cross platform directory path support
- Loading branch information
Showing
14 changed files
with
125 additions
and
79 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -396,3 +396,5 @@ FodyWeavers.xsd | |
|
||
# JetBrains Rider | ||
*.sln.iml | ||
|
||
.DS_Store |
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
33 changes: 33 additions & 0 deletions
33
src/corePackages/Core.CrossCuttingConcerns/Helpers/PlatformHelper.cs
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,33 @@ | ||
using System; | ||
namespace Core.CrossCuttingConcerns.Helpers | ||
{ | ||
public static class PlatformHelper | ||
{ | ||
public static string SecuredPathJoin(params string[] pathItems) | ||
{ | ||
string path; | ||
_ = Environment.OSVersion.Platform switch | ||
{ | ||
PlatformID.Unix => path = String.Join("/", pathItems), | ||
PlatformID.MacOSX => path = String.Join("/", pathItems), | ||
_ => path = String.Join("\\", pathItems), | ||
}; | ||
|
||
return path; | ||
} | ||
|
||
public static string GetDirectoryHeader() | ||
{ | ||
string file; | ||
_ = Environment.OSVersion.Platform switch | ||
{ | ||
PlatformID.Unix => file = "file://", | ||
PlatformID.MacOSX => file = "file://", | ||
_ => file = "", | ||
}; | ||
|
||
return file; | ||
} | ||
} | ||
} | ||
|
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
Oops, something went wrong.