lionel-rigoux / pandemic

This project has moved to pandemics.gitlab.io
https://pandemics.gitlab.io
BSD 3-Clause "New" or "Revised" License
8 stars 0 forks source link

Folder Recipes does not exist #2

Closed paulklemm closed 6 years ago

paulklemm commented 6 years ago

Problem

Pandemic does not create folder ~/.pandemic/recipes.

Steps to Recreate

This should yield: something like:

pandemic resource install recipe --as eisvogel https://github.com/Wandmalfarbe/pandoc-latex-template
/usr/local/lib/node_modules/pandemic/lib/fs-tools.js:6
    throw Error(`Folder ${folder} does not exist.`)
    ^

Error: Folder /Users/paul/.pandemic/recipes does not exist.
    at Object.listFiles (/usr/local/lib/node_modules/pandemic/lib/fs-tools.js:6:11)
    at Object.getRecipes (/usr/local/lib/node_modules/pandemic/lib/resources-tools.js:29:20)
    at Object.getTemplates (/usr/local/lib/node_modules/pandemic/lib/resources-tools.js:22:21)
    at Command.module.exports [as _action] (/usr/local/lib/node_modules/pandemic/manage/manage-install.js:16:19)
    at Command._run (/usr/local/lib/node_modules/pandemic/node_modules/caporal/lib/command.js:408:40)
    at Program._run (/usr/local/lib/node_modules/pandemic/node_modules/caporal/lib/program.js:165:16)
    at Program.parse (/usr/local/lib/node_modules/pandemic/node_modules/caporal/lib/program.js:268:17)
    at Object.<anonymous> (/usr/local/lib/node_modules/pandemic/index.js:43:6)
    at Module._compile (module.js:569:30)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:503:32)
    at tryModuleLoad (module.js:466:12)
    at Function.Module._load (module.js:458:3)
    at Function.Module.runMain (module.js:605:10)
    at startup (bootstrap_node.js:158:16)
    at bootstrap_node.js:575:

How to fix

I've created ~/.pandemic/recipes by hand and it worked :)

lionel-rigoux commented 6 years ago

Hi Paul, Nice catch. I indeed forgot to ensure subfolders creation. I will issue a patch very soon.

lionel-rigoux commented 6 years ago

Fixed by 899c4b6bc9ca16817327bdd842b22a565f808b93