diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2015-06-20 00:48:45 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2015-06-20 00:48:45 -0400 |
| commit | 248cb80084c96f34cc000a49b42488f9105a81ca (patch) | |
| tree | dc8066e05c6b0508c4d7ed58b1fcac6b972069e0 /MediaBrowser.WebDashboard/Api/DashboardService.cs | |
| parent | 2341ce09833441a096c339acd9e6df84f57c2f98 (diff) | |
vulcanize
Diffstat (limited to 'MediaBrowser.WebDashboard/Api/DashboardService.cs')
| -rw-r--r-- | MediaBrowser.WebDashboard/Api/DashboardService.cs | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/MediaBrowser.WebDashboard/Api/DashboardService.cs b/MediaBrowser.WebDashboard/Api/DashboardService.cs index 72744f249..f197914a5 100644 --- a/MediaBrowser.WebDashboard/Api/DashboardService.cs +++ b/MediaBrowser.WebDashboard/Api/DashboardService.cs @@ -272,6 +272,12 @@ namespace MediaBrowser.WebDashboard.Api return Path.GetExtension(path).EndsWith("html", StringComparison.OrdinalIgnoreCase); } + private void CopyFile(string src, string dst) + { + Directory.CreateDirectory(Path.GetDirectoryName(dst)); + File.Copy(src, dst, true); + } + public async Task<object> Get(GetDashboardPackage request) { var path = Path.Combine(_serverConfigurationManager.ApplicationPaths.ProgramDataPath, @@ -299,20 +305,24 @@ namespace MediaBrowser.WebDashboard.Api if (string.Equals(mode, "cordova", StringComparison.OrdinalIgnoreCase)) { // Overwrite certain files with cordova specific versions - var cordovaVersion = Path.Combine(path, "thirdparty", "cordova", "registrationservices.js"); + var cordovaVersion = Path.Combine(path, "cordova", "registrationservices.js"); File.Copy(cordovaVersion, Path.Combine(path, "scripts", "registrationservices.js"), true); File.Delete(cordovaVersion); // Delete things that are unneeded in an attempt to keep the output as trim as possible Directory.Delete(Path.Combine(path, "css", "images", "tour"), true); - Directory.Delete(Path.Combine(path, "thirdparty", "apiclient", "alt"), true); + Directory.Delete(Path.Combine(path, "apiclient", "alt"), true); File.Delete(Path.Combine(path, "thirdparty", "jquerymobile-1.4.5", "jquery.mobile-1.4.5.min.map")); + + Directory.Delete(Path.Combine(path, "bower_components"), true); + // But we do need this + CopyFile(Path.Combine(creator.DashboardUIPath, "bower_components", "webcomponentsjs", "webcomponents-lite.min.js"), Path.Combine(path, "bower_components", "webcomponentsjs", "webcomponents-lite.min.js")); } MinifyCssDirectory(Path.Combine(path, "css")); MinifyJsDirectory(Path.Combine(path, "scripts")); - MinifyJsDirectory(Path.Combine(path, "thirdparty", "apiclient")); + MinifyJsDirectory(Path.Combine(path, "apiclient")); MinifyJsDirectory(Path.Combine(path, "voice")); await DumpHtml(creator.DashboardUIPath, path, mode, culture, appVersion); |
