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.
Cross platform directory path support
- Loading branch information
1 parent
b3cf0d5
commit aa5c646
Showing
20 changed files
with
123 additions
and
79 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
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
Binary file not shown.
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 GetDirectorHeader() | ||
{ | ||
string file; | ||
_ = Environment.OSVersion.Platform switch | ||
{ | ||
PlatformID.Unix => file = "file://", | ||
PlatformID.MacOSX => file = "file://", | ||
_ => file = "", | ||
}; | ||
|
||
return file; | ||
} | ||
} | ||
} | ||
|
Binary file not shown.
Binary file not shown.
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.