Best practices for modifying tpl files then updating?
-
I may just be mentally challenged but I've not been able to successfully upgrade nodebb once. Every time I've had to back the directory up, redownload from git, reinstall everything and then modify all the tpl files I made changes in and then copy over the plugins.
Even the little minor commits you guys do, typically I'll do:
git stash
git pull
git pop
npm install
npm update
Though I think it's worth mentioning that after I noticed this never worked for me, I even tried updating it without stashing. Just a straight up git pull, npm install, npm update and nodebb still wouldn't start for me.
Every time I do the above, my install breaks and I have to re-download everything and start from scratch even though I modify like the header.tpl, footer.tpl and before there was the option for the social links I was editing those out.
If I'm missing something obvious here if someone could point me in the right direction that'd be great.
-
I've modified both tpl's and core files and my process is different (probably due to not knowing proper way). Not that any of this might be of help to you, but maybe others and myself due to replies.
- Download the latest git build via website (Download Zip).
- Use WinMergeU to merge changes.
- Shutdown nodebb
- Upload the new files to nodebb directory.
- run npm update
- try running, get error about bcrypt, delete bcrypt directory
- run npm update again
- profit..
I mainly develop on windows, using sublime text 2 and WinMergeU to merge. There might be a much easier way, if anyone can point it out to me much love.
-
Yeah I get the same error message as your number 6, except when I delete bcrypt and update it's just something else - rinse and repeat till I literally just delete node-modules and npm install.. lol
Most of my development is done on Mac, but git stash/pop should merge properly and if it doesn't you can go into the file and see where the conflicts are.
-
Is there currently no way to tell a theme to use custom tpl files? That would probably solve this issue.
I was wondering this myself before I dive into editing the templates.
-
Technically, there is no need to run
npm update
for packages other thannodebb-*
packages. So all you really need to do isnpm install
.However, you'd want to update the nodebb plugins/themes, so:
cd /path/to/your/nodebb/install git pull npm install cd node_modules ls nodebb-* | xargs npm update // I do not take responsibility for this command, if it burns your house down... cd ../ ./nodebb start
If you run into errors specified by #6, please do an
npm rebuild
to patch that right up.