Exemplo n.º 1
0
 DashAssetsPlugin.prototype._copyIcon = function(srcIconsPath, dstIconsPath, name) {
     var srcIconPath = td.Path.join(srcIconsPath, name);
     var dstIconPath = td.Path.join(dstIconsPath, name);
     if (td.FS.existsSync(srcIconPath)) {
         td.FS.copySync(srcIconPath, dstIconPath);
     }
 };
Exemplo n.º 2
0
            DashAssetsPlugin.prototype.onRendererBegin = function(event) {
                var from = td.Path.join(this.renderer.theme.basePath, 'assets');
                var to   = td.Path.join(event.outputDirectory, 'Contents', 'Resources', 'Documents', 'assets');
                td.ensureDirectoriesExist(to);

                if (td.FS.existsSync(from)) td.FS.copySync(from, to);

                this._copyIcons(event.outputDirectory);
            };
Exemplo n.º 3
0
 DashDocsetTheme.prototype.isOutputDirectory = function (path) {
     if (!td.FS.existsSync(td.Path.join(path, 'index.html')))
         return false;
     if (!td.FS.existsSync(td.Path.join(path, 'assets')))
         return false;
     if (!td.FS.existsSync(td.Path.join(path, 'assets', 'js', 'main.js')))
         return false;
     if (!td.FS.existsSync(td.Path.join(path, 'assets', 'images', 'icons.png')))
         return false;
     return true;
 };
Exemplo n.º 4
0
            InfoPlistPlugin.prototype.onRendererBegin = function(event) {
                var name = event.settings.name;

                var from = td.Path.join(this.renderer.theme.basePath, 'assets');
                var dir  = td.Path.join(event.outputDirectory, 'Contents');
                td.ensureDirectoriesExist(dir);

                var file = td.Path.join(dir, "Info.plist");
                var templateFile = td.FS.readFileSync(td.Path.join(this.renderer.theme.basePath, 'templates', 'Info.plist.hsb'), 'utf-8');
                td.writeFile(file, td.Handlebars.compile(templateFile)({ name: name, bundle: name.toLowerCase() }), false);
            };
Exemplo n.º 5
0
 DashAssetsPlugin.prototype.onRendererEnd = function(event) {
     var assetsDirectory = td.Path.join(event.outputDirectory, 'assets');
     td.FS.removeSync(assetsDirectory);
 };