Skip to content

Commit df463e7

Browse files
committed
Regular checking of manifest.
1 parent 3783828 commit df463e7

File tree

1 file changed

+10
-18
lines changed

1 file changed

+10
-18
lines changed

Tether/ManifestRegularCheck.cs

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public void Execute(IJobExecutionContext context)
3333
}
3434

3535
var pluginPath = Path.Combine(basePath, "plugins");
36-
var tempPluginPath = Path.Combine(pluginPath, "_temp");
36+
//var tempPluginPath = Path.Combine(pluginPath, "_temp");
3737

3838
var contents = string.Empty;
3939

@@ -49,7 +49,7 @@ public void Execute(IJobExecutionContext context)
4949
}
5050
else if (newUri.Scheme == "dns")
5151
{
52-
52+
throw new NotImplementedException("DNS scheme is not implemented yet");
5353
}
5454
else
5555
{
@@ -85,8 +85,6 @@ public void Execute(IJobExecutionContext context)
8585

8686
foreach (var manifestItem in manifest.Items.Where(f => new Regex(f.MachineFilter, RegexOptions.IgnoreCase | RegexOptions.CultureInvariant).IsMatch(Environment.MachineName)))
8787
{
88-
89-
9088
var assembly = ConfigurationSingleton.Instance.PluginAssemblies.FirstOrDefault(f => f.Name == manifestItem.PluginName);
9189

9290
if (assembly != null)
@@ -98,33 +96,27 @@ public void Execute(IJobExecutionContext context)
9896

9997
logger.Debug($"Assembly: {assembly.FullName}, Current assembly version = {assembly.Version}, expecting {manifestItem.PluginVersion}");
10098

101-
var zipPath = Path.Combine(tempPluginPath, assembly.Name + ".zip");
99+
var zipPath = Path.Combine(pluginPath, assembly.Name + ".zip");
102100

103-
if (!Directory.Exists(tempPluginPath))
104-
{
105-
Directory.CreateDirectory(tempPluginPath);
106-
}
101+
Directory.CreateDirectory(pluginPath);
107102

108103
client.DownloadFile(manifestItem.PluginDownloadLocation, zipPath);
109104

110-
Unzip(zipPath, tempPluginPath);
105+
Unzip(zipPath, pluginPath);
111106

112107
File.Delete(zipPath);
113108
}
114109
else
115110
{
116111
logger.Debug($"Assembly not found: {manifestItem.PluginName}, downloading from {manifestItem.PluginDownloadLocation}");
117112

118-
var zipPath = Path.Combine(tempPluginPath, manifestItem.PluginName + ".zip");
119-
120-
if (!Directory.Exists(tempPluginPath))
121-
{
122-
Directory.CreateDirectory(tempPluginPath);
123-
}
124-
113+
var zipPath = Path.Combine(pluginPath, manifestItem.PluginName + ".zip");
114+
115+
Directory.CreateDirectory(pluginPath);
116+
125117
client.DownloadFile(manifestItem.PluginDownloadLocation, zipPath);
126118

127-
Unzip(zipPath, tempPluginPath);
119+
Unzip(zipPath, pluginPath);
128120

129121
File.Delete(zipPath);
130122
}

0 commit comments

Comments
 (0)