If you edit files in the console they dont update in the editor
I found this out when I wanted to change the git branch and the files stayed the same
This is because the Glitch editor and the container don’t sync.
In order for programmatically, console-created files you need to run refresh
in the console. Note: refresh
also causes your project to restart.
thanks for the reply
@charliea21 As of Oct 2019, does this continue to be the status quo?
If that is the case, is there a way to perform a “refresh” using the package.json file?
Do you have any template for this?
Yes you still need to run refresh
when you want to sync files between the editor and console. You could make a Nodejs script automatically run refresh
. However, that would stop your app and force it to restart.
Can you show me how to setup this NodeJs script? Thanks,
I use this script in one of my projects:
const { exec } = require('child_process');
setInterval(function() {
exec("refresh", function(){})
},240000); // 240000 is in MILLISECONDS
Feel free to change 240000
to any time you want in milliseconds.