syncthingController.js trouble

I’m noticing when I make a change to syncthingController.js the changes do not show up in syncthing after saving and running go run build.go compile. Am I doing something wrong here? Any go file I make a change to and save/compile… the change shows immediately upon recompile but not with the GUI/angular files. How do I force any new build of ST to include the latest copy of syncthingController.js that I saved?

Set the STGUIASSETS environment variable to point at the gui dir and they will be loaded from there directly. Otherwise the compiled in files are loaded.

1 Like

Thanks for the fast response. Unfortunately I’m still not quite grokking this. I see in the docs that this is an example of usage (STGUIASSETS=gui bin/syncthing) however I cant seem to get it working.

I tried:

STGUIASSETS=gui bin/syncthing STGUIASSETS=gui bin\syncthing.exe STGUIASSETS=C:\path\to\gui\dir

and a few other combinations (developing on Windows here) and I cant seem to get it to do what I expect. What I am doing is making a slight change each time in the wording/punctuation of something in the js file and expecting that change to be in each new build I do of the exe. This is more of a sanity check for me until I’m certain that I have this figured out. Then I will worry about continuing to code.

Ok I think I might have figured it out by trial and error.

Looks like the custom GUI has to be copied into the %AppData%\Syncthing folder that the other configs are located in. Then it uses those assets instead of the built in ones right? I was assuming (I guess incorrectly) that it was recompiling the new code into the .exe

Is that about right?

If you set the environment variable you don’t have to recompile the exe each time you make GUI changes.

To include the GUI changes in an exe run build.sh assets before you build the exe.

If you’re on Windows, you need to set the env var separately to starting syncthing.

> SET STGUIASSETS=whatever 
> bin\syncthing.exe
1 Like