Code Monkey home page Code Monkey logo

Comments (3)

simondean avatar simondean commented on May 29, 2024

I've created an example of the issue in https://github.com/simondean/widdershins-issues/tree/master/exit-code

Here's an example of the shins output when an include file does not exist, including a printout of shins's exit code:

$ node_modules/.bin/shins index.md -o index.html --inline --attr --customcss
{ Error: widdershins-issues/exit-code/node_modules/shins/source/layouts/layout.ejs:18
    16| <% var language_tabs = current_page.data.language_tabs || []; %>
    17| <% if (current_page.data.includes) { for (var include in current_page.data.includes) { %>
 >> 18|   <% page_content += partial(current_page.data.includes[include]) %>
    19| <% } %>
    20| <!doctype html>
    21| <html lang="en">

ENOENT: no such file or directory, open 'widdershins-issues/exit-code/node_modules/shins/source/includes/_does-not-exist.md'
    at Object.fs.openSync (fs.js:667:18)
    at Object.fs.readFileSync (fs.js:572:33)
    at Object.partial (widdershins-issues/exit-code/node_modules/shins/index.js:69:25)
    at eval (eval at compile (widdershins-issues/exit-code/node_modules/ejs/lib/ejs.js:584:12), <anonymous>:18:24)
    at returnedFn (widdershins-issues/exit-code/node_modules/ejs/lib/ejs.js:615:17)
    at tryHandleCache (widdershins-issues/exit-code/node_modules/ejs/lib/ejs.js:251:36)
    at Object.exports.renderFile (widdershins-issues/exit-code/node_modules/ejs/lib/ejs.js:472:10)
    at widdershins-issues/exit-code/node_modules/shins/index.js:313:13
    at new Promise (<anonymous>)
    at Object.render (widdershins-issues/exit-code/node_modules/shins/index.js:201:28)
  errno: -2,
  code: 'ENOENT',
  syscall: 'open',
  path: 'widdershins-issues/exit-code/node_modules/shins/source/layouts/layout.ejs' }
$ echo $?
0

from shins.

MikeRalphson avatar MikeRalphson commented on May 29, 2024

Thanks for the report, will take a look.

from shins.

MikeRalphson avatar MikeRalphson commented on May 29, 2024

Should be fixed in v2.2.1-6. If options.cli is true then shins will exit with error-code 1 on any non-existing include, script, image etc. If options.cli is not truthy then a warning is logged to stderr but rendering will continue.

Thanks again for the prompt.

from shins.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.