Skip backing up public source code
This commit is contained in:
parent
c3a9a33526
commit
de61329140
@ -85,7 +85,7 @@ public class Plugin : BasePlugin<PluginConfiguration>, IHasWebPages
|
|||||||
var indexPath = Path.Join(applicationPaths.WebPath, "index.html");
|
var indexPath = Path.Join(applicationPaths.WebPath, "index.html");
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
InjectSkipButton(indexPath, Path.Join(introsDirectory, "index-pre-skip-button.html"));
|
InjectSkipButton(indexPath);
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
@ -328,8 +328,7 @@ public class Plugin : BasePlugin<PluginConfiguration>, IHasWebPages
|
|||||||
/// Inject the skip button script into the web interface.
|
/// Inject the skip button script into the web interface.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="indexPath">Full path to index.html.</param>
|
/// <param name="indexPath">Full path to index.html.</param>
|
||||||
/// <param name="backupPath">Full path to create a backup of index.html at.</param>
|
private void InjectSkipButton(string indexPath)
|
||||||
private void InjectSkipButton(string indexPath, string backupPath)
|
|
||||||
{
|
{
|
||||||
// Parts of this code are based off of JellyScrub's script injection code.
|
// Parts of this code are based off of JellyScrub's script injection code.
|
||||||
// https://github.com/nicknsy/jellyscrub/blob/4ce806f602988a662cfe3cdbaac35ee8046b7ec4/Nick.Plugin.Jellyscrub/JellyscrubPlugin.cs
|
// https://github.com/nicknsy/jellyscrub/blob/4ce806f602988a662cfe3cdbaac35ee8046b7ec4/Nick.Plugin.Jellyscrub/JellyscrubPlugin.cs
|
||||||
@ -349,10 +348,6 @@ public class Plugin : BasePlugin<PluginConfiguration>, IHasWebPages
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Backup the original version of the web interface
|
|
||||||
_logger.LogInformation("Backing up index.html to {Backup}", backupPath);
|
|
||||||
File.WriteAllText(backupPath, contents);
|
|
||||||
|
|
||||||
// Inject a link to the script at the end of the <head> section.
|
// Inject a link to the script at the end of the <head> section.
|
||||||
// A regex is used here to ensure the replacement is only done once.
|
// A regex is used here to ensure the replacement is only done once.
|
||||||
_logger.LogDebug("Injecting script tag");
|
_logger.LogDebug("Injecting script tag");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user