From 90ffc33131ab45c89e3334596f5e11a41922a87c Mon Sep 17 00:00:00 2001 From: Luke Date: Thu, 20 Oct 2016 13:33:53 -0400 Subject: [PATCH 01/14] Prevent silica from attempting to handle tel:// links --- src/silica.es6 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/silica.es6 b/src/silica.es6 index 8591d81..6531bdd 100644 --- a/src/silica.es6 +++ b/src/silica.es6 @@ -621,7 +621,7 @@ var Silica = { }, _handle_href(evt){ var path = this.getAttribute("href") - if (path === "#" || path === "") + if (path === "#" || path === "" || path.indexOf("tel://") == 0) { return; } From ab87a099eedc407b3ec365c0264017190bdfc73f Mon Sep 17 00:00:00 2001 From: Luke Date: Thu, 20 Oct 2016 14:21:08 -0400 Subject: [PATCH 02/14] Prevent silica from attempting to handle any protocol: links --- src/silica.es6 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/silica.es6 b/src/silica.es6 index 6531bdd..649cce3 100644 --- a/src/silica.es6 +++ b/src/silica.es6 @@ -621,9 +621,9 @@ var Silica = { }, _handle_href(evt){ var path = this.getAttribute("href") - if (path === "#" || path === "" || path.indexOf("tel://") == 0) - { - return; + const protocolCheckRegex = /[a-zA-Z]+\:+/g; + if(protocolCheckRegex.exec(path)!=null) { + return; } evt.preventDefault(); Silica.goTo(path); From 221e58b4a0448419361009763e501777c51f9eb6 Mon Sep 17 00:00:00 2001 From: Luke Date: Mon, 31 Oct 2016 11:18:04 -0400 Subject: [PATCH 03/14] Prevent silica from attempting to handle any protocol: links --- src/silica.es6 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/silica.es6 b/src/silica.es6 index 649cce3..66c93ed 100644 --- a/src/silica.es6 +++ b/src/silica.es6 @@ -620,9 +620,9 @@ var Silica = { } }, _handle_href(evt){ - var path = this.getAttribute("href") + var path = this.getAttribute("href"); const protocolCheckRegex = /[a-zA-Z]+\:+/g; - if(protocolCheckRegex.exec(path)!=null) { + if(protocolCheckRegex.exec(path)!=null || path === "#" || path === "") { return; } evt.preventDefault(); From 375e4be412b76541122ddb86e2360efa55b1cfff Mon Sep 17 00:00:00 2001 From: Luke Date: Mon, 31 Oct 2016 12:02:46 -0400 Subject: [PATCH 04/14] update readme (contents moved to wiki) --- Readme.md | 99 ++++--------------------------------------------------- 1 file changed, 7 insertions(+), 92 deletions(-) diff --git a/Readme.md b/Readme.md index 8b470cb..a735871 100644 --- a/Readme.md +++ b/Readme.md @@ -1,99 +1,14 @@ -## Contexts - -Each directive is bound to a specific context which specifies the object the values and actions are bound to. There are 3 types of contexts. - -1. Global - Referred to by starting with a capital letter. -2. Model -3. Controller - -### Global Context - -A Global context must start with a capital letter and be accessible from the window scope. A single global context must be specified as Silica's context by name - `Silica.setContext("GC")` where `GC` is accessible through `window.GC` or `window["GC"]`. All instances of Controllers used in a `data-controller` expression must be a member of a **Global** context; the value set as the Silica context is recommended. - -### Model Context - -A Model context can be seen as the most fine grained. Silica expressions will attempt to bind to the inner most model context first before walking up context tree to the nearest Controller Context if the property cannot be found on the model. Model contexts are created using the `data-repeat="model in list"` expression where model will be the reference and list is an array. - -Example: - +## Installation +Install cli via NPM ``` -
    -
  • {{category.name}}
  • -
+npm install silica -g ``` -### Controller Context - -A Controller context is a medium grained context. Model contexts have higher priority than Controllers so any overlapping properties will go to the model. Unlike model contexts Controller contexts don't continue to walk up the Context tree if a property does not exist. Controller's should be used for all actionable expressions. - - -## Expressions - -Expressions are `data-*` attributes known to Silica. The value of the attribute is a semi-evald value. Values can be chained and can consist of functions and regular properties. A function will halt the execution of a chain. - -Example: - -Here we have a div that will be visible if `is_editable` evaluates to true. `is_editable` can be a function or just a property set to true or false. - -``` -
Change
-``` - -Similar to the previous, notice the `!` which acts as expected. -The `. (dot)` operator takes precedence over the `!`. - +Install silica js library & save to bower.json ``` -
I am empty
+bower install silica --save ``` -### Actionable +Documentation can be found in the Wiki -These are expressions which bind to a user's actions. -Actionable expressions will call the value specified which **must** be a function, **always** passing the element as the **first** argument to the function. -If a model is specified it will be passed as the **second** argument. - -* `data-click` -* `data-dblclick` -* `data-blur` -* `data-submit` - -### Output - -These are your binding expressions that output a value. -The properties specified can be functions, primitives, or objects. -**DO NOT** include parenthesis of a function. Function properties are called with out any arguments and should be viewed as computable properties. A function will get called with its `this` context set to the object. - -* `data-class` - Set a css class to the returned value -* `data-show` - Toggles the css class _hidden_ based on truthiness -* `data-if` - Removes the element from the DOM based on truthiness, `data-show` - is preferable -* `data-style` - Sets the css style attribute to the returned value -* `data-repeat` - Iterate through an array with its first child element as the template -* `data-include` - Replace any children with the html specified by URL. The - value specified will be `eval`d, so if it is a string, surround it in `''` -(single quotes). The compiler will **NOT** `eval`, but expects the same -syntax. -* `data-model` - Bind the innerHTML, value, checked attributes to the value specified. If the element is editable, these are 2-way bindings -* `data-filter` - Used in conjunction with `data-model` **only**; allows a filter to be applied to the value returned by model before outputing the value. -* `data-silica="attribute=value"`- Bind the _value_ to the specified _attribute_ - - -This will pipe the value of `category.amount` through the `currency` filter before setting the `span.innerHTML` - -``` - -``` - -The `data-model` and `data-filter` expressions are so common that there is a shortcut; specified using mustache style with optional pipes. - -Same as above - -``` -{{category.amount|currency}} -``` - -No filter: - -``` -{{category.name}} -``` +https://github.com/BakedSoftware/silica/wiki/ \ No newline at end of file From c46a9051d1a0d6f31317468e6de31e027542eda8 Mon Sep 17 00:00:00 2001 From: Luke Date: Mon, 31 Oct 2016 12:05:56 -0400 Subject: [PATCH 05/14] update readme (contents moved to wiki) --- Readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Readme.md b/Readme.md index a735871..4ed7792 100644 --- a/Readme.md +++ b/Readme.md @@ -11,4 +11,4 @@ bower install silica --save Documentation can be found in the Wiki -https://github.com/BakedSoftware/silica/wiki/ \ No newline at end of file +https://github.com/BakedSoftware/silica/wiki/ From 955ce8b805429d1b3f4001004ba5391cf145b825 Mon Sep 17 00:00:00 2001 From: Luke Date: Wed, 11 Oct 2017 13:59:00 -0400 Subject: [PATCH 06/14] changes for yarn (buh bye bower) --- src/cli/silica-build.js | 2 +- src/cli/silica-create.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cli/silica-build.js b/src/cli/silica-build.js index 40c7650..57b81c3 100644 --- a/src/cli/silica-build.js +++ b/src/cli/silica-build.js @@ -253,7 +253,7 @@ function writeStyles() { } } catch(err){} - fs.copySync(path.join('bower_components'), path.join('build', 'bower_components')); + fs.copySync(path.join('node_modules'), path.join('build', 'node_modules')); afterScriptCaller(); } diff --git a/src/cli/silica-create.js b/src/cli/silica-create.js index 3d75da6..492fa33 100644 --- a/src/cli/silica-create.js +++ b/src/cli/silica-create.js @@ -44,7 +44,7 @@ const indexTemplate = ` {{name}} - {{version}} - + From 2ae1d20da178c61026f037dbf9d8af70c9514bcd Mon Sep 17 00:00:00 2001 From: Luke Date: Wed, 11 Oct 2017 14:07:50 -0400 Subject: [PATCH 07/14] remove bower references in favor of yarn --- src/cli/silica-create.js | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/src/cli/silica-create.js b/src/cli/silica-create.js index 492fa33..6be2f2f 100644 --- a/src/cli/silica-create.js +++ b/src/cli/silica-create.js @@ -99,28 +99,18 @@ fs.writeFileSync(path.join(projectName, 'src', 'controllers', 'app_cntrl.js'), a fs.writeFileSync(path.join(projectName, 'src', 'app.js'), appTemplate); fs.writeFileSync(path.join(projectName, 'src', 'styles', 'app.styl'), styleTemplate); -// Setup bower +// Setup yarn -console.log("Set up bower (Choose any values)"); +console.log("Set up yarn (Choose any values)"); -var bower = spawnSync('bower', +var yarn = spawnSync('yarn', ['init'], { stdio: [0, 1, 2], cwd: projectName }); -var bower_install = spawnSync('bower', - ['install', 'jquery', 'silica'], +var yarn_install = spawnSync('yarn', + ['install', 'silica'], { 'cwd': projectName }); -// Setup npm -var npm_init = spawnSync('npm', - ['init'], - { - stdio: [0, 1, 2], - cwd: projectName - }); -spawnSync('npm', - ['install', '--save', 'babel-preset-es2015'], - { 'cwd': projectName}); From 66e055a135dd8acafd0e334246f4db3e7c2cb000 Mon Sep 17 00:00:00 2001 From: Luke Date: Thu, 20 Oct 2016 13:33:53 -0400 Subject: [PATCH 08/14] Prevent silica from attempting to handle tel:// links --- src/silica.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/silica.js b/src/silica.js index 691fc2f..2b05d45 100644 --- a/src/silica.js +++ b/src/silica.js @@ -650,10 +650,10 @@ window['Silica'] = { } }, _handle_href(evt){ - var path = this.getAttribute("href"); - const protocolCheckRegex = /[a-zA-Z]+\:+/g; - if(protocolCheckRegex.exec(path)!=null || path === "#" || path === "") { - return; + var path = this.getAttribute("href") + if (path === "#" || path === "" || path.indexOf("tel://") == 0) + { + return; } evt.preventDefault(); evt.stopPropagation(); From 01cb7ee158ee18b16530a759aca1bf684e29775b Mon Sep 17 00:00:00 2001 From: Luke Date: Thu, 20 Oct 2016 14:21:08 -0400 Subject: [PATCH 09/14] Prevent silica from attempting to handle any protocol: links --- src/silica.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/silica.js b/src/silica.js index 2b05d45..f375843 100644 --- a/src/silica.js +++ b/src/silica.js @@ -651,9 +651,9 @@ window['Silica'] = { }, _handle_href(evt){ var path = this.getAttribute("href") - if (path === "#" || path === "" || path.indexOf("tel://") == 0) - { - return; + const protocolCheckRegex = /[a-zA-Z]+\:+/g; + if(protocolCheckRegex.exec(path)!=null) { + return; } evt.preventDefault(); evt.stopPropagation(); From 53797d741ff4934af93ce34f237746fa41a9b2e0 Mon Sep 17 00:00:00 2001 From: Luke Date: Mon, 31 Oct 2016 11:18:04 -0400 Subject: [PATCH 10/14] Prevent silica from attempting to handle any protocol: links --- src/silica.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/silica.js b/src/silica.js index f375843..691fc2f 100644 --- a/src/silica.js +++ b/src/silica.js @@ -650,9 +650,9 @@ window['Silica'] = { } }, _handle_href(evt){ - var path = this.getAttribute("href") + var path = this.getAttribute("href"); const protocolCheckRegex = /[a-zA-Z]+\:+/g; - if(protocolCheckRegex.exec(path)!=null) { + if(protocolCheckRegex.exec(path)!=null || path === "#" || path === "") { return; } evt.preventDefault(); From 7e8cd4b0b30633b3f6e08038d0e5dd4df87a186a Mon Sep 17 00:00:00 2001 From: Luke Date: Sun, 15 Oct 2017 15:03:20 -0400 Subject: [PATCH 11/14] fix for externs create --- src/cli/silica-create.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cli/silica-create.js b/src/cli/silica-create.js index 1f85f10..64b06d5 100644 --- a/src/cli/silica-create.js +++ b/src/cli/silica-create.js @@ -98,7 +98,7 @@ fs.writeFileSync(path.join(projectName, 'src', 'index.html'), indexTemplate); fs.writeFileSync(path.join(projectName, 'src', 'controllers', 'app_cntrl.js'), appCntrlTemplate); fs.writeFileSync(path.join(projectName, 'src', 'app.js'), appTemplate); fs.writeFileSync(path.join(projectName, 'src', 'styles', 'app.styl'), styleTemplate); -fs.writeFileSync(path.join(projectName 'src', 'extern.js'), "//See closure compiler docs for usage of this file"); +fs.writeFileSync(path.join(projectName, 'src', 'externs.js'), "//See closure compiler docs for usage of this file"); // Setup yarn From 04d359771be3c2f579bf8040551e5b4768fe700b Mon Sep 17 00:00:00 2001 From: Luke Date: Sun, 15 Oct 2017 15:10:47 -0400 Subject: [PATCH 12/14] merge resolved --- .idea/workspace.xml | 747 +++++++++++++++++++++++++++++++++++++++ src/cli/silica-create.js | 7 - 2 files changed, 747 insertions(+), 7 deletions(-) create mode 100644 .idea/workspace.xml diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 0000000..4f94198 --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,747 @@ + + + + + + + + + + + + + + + + + + + + ca + cannot find + cannot find mo + cannot find mod + cannot find modu + cannot find modul + cannot find module + . + .gzip + r + rimraf + f + fs-ex + fs-extr + bower + fs-extra + S + Strt + Strting + Strting bu + Strting bui + Strting buil + Strting build + Starting build + require + removeS + transform + removeSync + readFileS + remove + + + goog.require + + + + + + + + + + + + + + true + + false + true + + + true + DEFINITION_ORDER + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + project + + + + + + + + + + + + + + + + + + + + + 1476984429851 + + + 1476984833593 + + + 1476987226037 + + + 1476987668866 + + + 1477927084883 + + + 1477929766713 + + + 1477929956496 + + + 1507744740925 + + + 1507745270129 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/cli/silica-create.js b/src/cli/silica-create.js index c425624..64b06d5 100644 --- a/src/cli/silica-create.js +++ b/src/cli/silica-create.js @@ -111,13 +111,6 @@ var yarn = spawnSync('yarn', cwd: projectName }); -<<<<<<< HEAD var yarn_add = spawnSync('yarn', ['add', 'silica'], { 'cwd': projectName }); -======= -var yarn_install = spawnSync('yarn', - ['install', 'silica'], - { 'cwd': projectName }); - ->>>>>>> 2ae1d20da178c61026f037dbf9d8af70c9514bcd From 93b5550a9770854a0f45a5a53f15e3d33abe4bdf Mon Sep 17 00:00:00 2001 From: Luke Date: Sun, 15 Oct 2017 15:14:21 -0400 Subject: [PATCH 13/14] added intellij folder to git ignore --- .gitignore | 2 +- .idea/workspace.xml | 747 -------------------------------------------- 2 files changed, 1 insertion(+), 748 deletions(-) delete mode 100644 .idea/workspace.xml diff --git a/.gitignore b/.gitignore index a2f6293..ff79be6 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,4 @@ build build_cache compiled node_modules -bower_components +.idea diff --git a/.idea/workspace.xml b/.idea/workspace.xml deleted file mode 100644 index 4f94198..0000000 --- a/.idea/workspace.xml +++ /dev/null @@ -1,747 +0,0 @@ - - - - - - - - - - - - - - - - - - - - ca - cannot find - cannot find mo - cannot find mod - cannot find modu - cannot find modul - cannot find module - . - .gzip - r - rimraf - f - fs-ex - fs-extr - bower - fs-extra - S - Strt - Strting - Strting bu - Strting bui - Strting buil - Strting build - Starting build - require - removeS - transform - removeSync - readFileS - remove - - - goog.require - - - - - - - - - - - - - - true - - false - true - - - true - DEFINITION_ORDER - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - project - - - - - - - - - - - - - - - - - - - - - 1476984429851 - - - 1476984833593 - - - 1476987226037 - - - 1476987668866 - - - 1477927084883 - - - 1477929766713 - - - 1477929956496 - - - 1507744740925 - - - 1507745270129 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file From c4d3991f8e317394ca61d7704b31023dc88e67ac Mon Sep 17 00:00:00 2001 From: Luke Date: Tue, 29 May 2018 11:18:37 -0400 Subject: [PATCH 14/14] noviews --- src/cli/silica-build.js | 117 ++++++++++++++++++++++------------------ 1 file changed, 64 insertions(+), 53 deletions(-) diff --git a/src/cli/silica-build.js b/src/cli/silica-build.js index 06c450d..3261ef3 100644 --- a/src/cli/silica-build.js +++ b/src/cli/silica-build.js @@ -12,6 +12,7 @@ const stylus = require('stylus') program .option('-d --done [script]', 'The path to a script to run after build') .option('-s --styles [path]', 'Directory of additional style imports relative to the src directory') + .option('-n --noviews', 'do not process any views, styles, or images') .parse(process.argv) var afterScript = program.done @@ -26,8 +27,12 @@ fs.removeSync('build') fs.mkdirSync('build') fs.mkdirSync(path.join('build', 'js')) -fs.mkdirSync(path.join('build', 'css')) -fs.mkdirSync(path.join('build', 'views')) + +if (!program.noviews) { + fs.mkdirSync(path.join('build', 'css')) + fs.mkdirSync(path.join('build', 'views')) +} + fs.copySync('src', path.join(cachePath, 'src')) function walk (dir) { @@ -93,20 +98,22 @@ function preprocessView (readPath, writePath) { fs.writeFileSync(writePath, content) } -console.log('Preprocessing views...') +if (!program.noviews) { + console.log('Preprocessing views...') -// Check the index file -preprocessView(path.join(cachePath, 'src', 'index.html'), path.join('build', 'index.html')) + // Check the index file + preprocessView(path.join(cachePath, 'src', 'index.html'), path.join('build', 'index.html')) -// Check all other views -var views = walk(path.join(cachePath, 'src', 'views')) -for (var i = 0, len = views.length; i < len; i++) { - var writeTo = views[i].split(path.sep) - writeTo.shift() - writeTo.shift() - preprocessView(views[i], path.join('build', writeTo.join(path.sep))) + // Check all other views + var views = walk(path.join(cachePath, 'src', 'views')) + for (var i = 0, len = views.length; i < len; i++) { + var writeTo = views[i].split(path.sep) + writeTo.shift() + writeTo.shift() + preprocessView(views[i], path.join('build', writeTo.join(path.sep))) + } + console.log('Preprocess Finished') } -console.log('Preprocess Finished') var asyncLock = 0 @@ -196,8 +203,18 @@ closureCompiler.run(function (exitCode, stdOut, stdErr) { }) // Generate sprite styles -var spriteCSSPath = path.join(cachePath, 'src', 'styles', 'sprite.css') -var totalCSS = '' +if (!program.noviews) { + var spriteCSSPath = path.join(cachePath, 'src', 'styles', 'sprite.css') + var totalCSS = '' + + try { + fs.statSync(path.join('src', 'images')).isDirectory() + fs.copySync(path.join('src', 'images'), path.join('build', 'images')) + } catch (err) { + } + + var spriteSrc = path.join('src', 'images', 'sprites') +} function stylusCallback (err, css) { if (err) { @@ -208,14 +225,6 @@ function stylusCallback (err, css) { } } -try { - fs.statSync(path.join('src', 'images')).isDirectory() - fs.copySync(path.join('src', 'images'), path.join('build', 'images')) -} catch (err) { -} - -var spriteSrc = path.join('src', 'images', 'sprites') - function stylusRender () { var styles = walk(path.join(cachePath, 'src', 'styles')).filter(function (name) { return name[0] !== '.' && name !== 'base.styl' && name !== 'fonts.styl' && name.endsWith('.styl') @@ -258,40 +267,42 @@ function writeStyles () { afterScriptCaller() } -try { - fs.statSync(spriteSrc) - if (fs.readdirSync(spriteSrc).length > 0) { - nsg({ - src: [ - path.join(spriteSrc, '*.png') - ], - spritePath: path.join('build', 'images', 'sprite.png'), - stylesheetPath: spriteCSSPath, - stylesheet: 'css', - stylesheetOptions: { - prefix: 'icon-', - pixelRatio: 2, - spritePath: '../images/sprite.png' - }, - compositor: require('node-sprite-generator-jimp') - }, function (err) { - if (err) { - if (fs.readdirSync(spriteSrc).length > 0) { - console.log('Error Generating Sprites', err) +if (!program.noviews) { + try { + fs.statSync(spriteSrc) + if (fs.readdirSync(spriteSrc).length > 0) { + nsg({ + src: [ + path.join(spriteSrc, '*.png') + ], + spritePath: path.join('build', 'images', 'sprite.png'), + stylesheetPath: spriteCSSPath, + stylesheet: 'css', + stylesheetOptions: { + prefix: 'icon-', + pixelRatio: 2, + spritePath: '../images/sprite.png' + }, + compositor: require('node-sprite-generator-jimp') + }, function (err) { + if (err) { + if (fs.readdirSync(spriteSrc).length > 0) { + console.log('Error Generating Sprites', err) + } + } else { + console.log('Sprite Generated') } - } else { - console.log('Sprite Generated') - } - + + stylusRender() + totalCSS += fs.readFileSync(spriteCSSPath, 'utf8') + writeStyles() + }) + } else { stylusRender() - totalCSS += fs.readFileSync(spriteCSSPath, 'utf8') writeStyles() - }) - } else { + } + } catch (err) { stylusRender() writeStyles() } -} catch (err) { - stylusRender() - writeStyles() }