tortilla
tortilla copied to clipboard
Tortilla should not hardcode its paths during repository initialization
Once you initialize your repository with tortilla init
it hardcodes Tortilla's paths for that project, so if you will later decide to change your npm global path you will have to re-initialize the repository to be able to use it. It should find the location relative to the PATH
from the environment variables instead:
$ echo $PATH
~/.npm-packages/bin:~/.npm-packages/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:[etc.. etc..]
This is the error you will get:
$ tortilla step edit --root
module.js:491
throw err;
^
Error: Cannot find module '/usr/lib/node_modules/tortilla/src/hooks/pre-rebase.js'
at Function.Module._resolveFilename (module.js:489:15)
at Function.Module._load (module.js:439:25)
at Function.Module.runMain (module.js:609:10)
at startup (bootstrap_node.js:158:16)
at bootstrap_node.js:598:3
The pre-rebase hook refused to rebase.
Previously I had Tortilla globally installed at /usr/lib/node_modules/
, while later I moved it to ~/.npm-packages/
.
So the script which was previously at /usr/lib/node_modules/tortilla/src/hooks/pre-rebase.js
is now located at ~/.npm-packages/lib/node_modules/tortilla/src/hooks/pre-rebase.js
.
Re-initializing the repository (tortilla init
) solves the problem.