-
Notifications
You must be signed in to change notification settings - Fork 66
ARM architecture support. #99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: release
Are you sure you want to change the base?
Changes from all commits
8ef264e
fa4e52b
5053ab9
b9efdab
9483fc3
1b2c507
585dd5e
54662fa
594da7a
c7a3373
76d823c
ae28aed
c12ad1e
5aa0f98
eb1c679
679c043
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| using System.IO; | ||
|
|
||
| namespace Knapcode.TorSharp.Tools | ||
| { | ||
| internal static class DirectoryUtility | ||
| { | ||
| public static void CreateDirectoryIfNotExists(params string[] path) | ||
| { | ||
| foreach (var p in path) | ||
| CreateDirectoryIfNotExists(p); | ||
| } | ||
|
|
||
| public static void CreateDirectoryIfNotExists(string path) | ||
| { | ||
| if (!Directory.Exists(path)) | ||
| Directory.CreateDirectory(path); | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| } | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| using System; | ||
|
|
||
| namespace Knapcode.TorSharp.Tools | ||
| { | ||
| internal static class EnumHelper | ||
| { | ||
| public static bool IsArm(this TorSharpArchitecture arch) | ||
| { | ||
| return arch == TorSharpArchitecture.Arm32 || arch == TorSharpArchitecture.Arm64; | ||
| } | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -26,7 +26,7 @@ public async Task ApplySettings(Tool tool, TorSharpSettings settings) | |
| try | ||
| { | ||
| // write first to a temporary file | ||
| temporaryPath = Path.GetTempFileName(); | ||
| temporaryPath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Interesting: https://rules.sonarsource.com/csharp/RSPEC-5445. |
||
| TextReader reader; | ||
|
|
||
| // read the existing configuration, if there is some | ||
|
|
@@ -57,15 +57,12 @@ public async Task ApplySettings(Tool tool, TorSharpSettings settings) | |
| // write the remaining lines | ||
| foreach (var pair in dictionary.OrderBy(p => p.Key)) | ||
| { | ||
| if (pair.Value != null && pair.Value.Any()) | ||
| if (pair.Value?.Any() == true) | ||
| { | ||
| foreach (var value in pair.Value) | ||
| foreach (var value in pair.Value.Where(a => a != null)) | ||
| { | ||
| if (value != null) | ||
| { | ||
| string newLine = _format.CreateLine(new KeyValuePair<string, string>(pair.Key, value)); | ||
| await writer.WriteLineAsync(newLine).ConfigureAwait(false); | ||
| } | ||
| string newLine = _format.CreateLine(new KeyValuePair<string, string>(pair.Key, value)); | ||
| await writer.WriteLineAsync(newLine).ConfigureAwait(false); | ||
| } | ||
| } | ||
| } | ||
|
|
@@ -109,7 +106,6 @@ public async Task ApplySettings(Tool tool, TorSharpSettings settings) | |
| } | ||
| } | ||
| } | ||
|
|
||
| } | ||
| } | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.