Closed jelling closed 2 years ago
@jelling There are two options:
1) "Use 'pcsync' to fix ...". So, you can call pcsync pullAll
to download all remote files from Playcanvas Editor (WARNING: it overwrites local files). And only after it call pcwatch
2) "... use '--force' to skip this check". For example, pcwatch --force
. In this case, local files are uploaded to Playcanvas Editor, but there are some remote files in Editor that are not in your local repo (so, also be careful careful with it).
@querielo as you can see in the log above, I ran pcsync pullAll
but after that I still get the "differences found" error. That shouldn't be, should it?
And then when I run pcwatch --force
afterwards, changes on local are not synced to remote.
Is there a cache somewhere that's possibly corrupted? Or is there possibly an issue with this project in specific?
@jelling Would you be able to share the following please to help us reproduce?
please also provide a full path to your target directory and the directory where playcanvas-sync is installed. Did it all work correctly in another target directory? Does your project have a pcconfig.json file? Do you use environment variables? After pullAll, please check if individual files are correctly downloaded to your computer, e.g. whether you can open a script file. From our past experience, the most likely cause of your issue is incorrect configuration.
I've tried to reproduce this with the following setup on a Mac with pc-sync installed globally
.pcconfig
in the home directory
{
"PLAYCANVAS_API_KEY": "XXXX",
"PLAYCANVAS_TARGET_DIR": "/Users/stevenyau/Snapchat/Dev/bitmoji-library",
"PLAYCANVAS_BAD_FILE_REG": "^\\.|~$|pcconfig\\.json",
"PLAYCANVAS_BAD_FOLDER_REG": "\\."
}
A project in /Users/stevenyau/Snapchat/Dev/bitmoji-library
with a pcconfig.json
file
{
"PLAYCANVAS_BRANCH_ID": "40ddb1ac-58d3-40b9-8c6e-a091a29175eb",
"PLAYCANVAS_PROJECT_ID": 721733
}
And a different project in /Users/stevenyau/Snapchat/Dev/bitmoji-plaza
{
"PLAYCANVAS_BRANCH_ID": "c96f8dff-b9b9-4369-9540-62ee398ff1f8",
"PLAYCANVAS_PROJECT_ID": 681065
}
And doing the following on command line:
~% pcsync pullAll
~% pcwatch
Change a text file to check it syncs correctly. Change ~/.pcconfig
PLAYCANVAS_TARGET_DIR
to the other project
And doing the following on command line:
~% pcsync pullAll
~% pcwatch
Change a text file to check it syncs correctly.
I've not yet run into the issue that you've hit @jelling.
Do you have different setup to this?
I also tried having all the setup in ~/.pcconfig
{
"PLAYCANVAS_API_KEY": "XXXXXX",
"PLAYCANVAS_TARGET_DIR": "/Users/stevenyau/Snapchat/Dev/test-folder-one",
"PLAYCANVAS_BAD_FILE_REG": "^\\.|~$|pcconfig\\.json",
"PLAYCANVAS_BAD_FOLDER_REG": "\\.",
"PLAYCANVAS_BRANCH_ID": "40ddb1ac-58d3-40b9-8c6e-a091a29175eb",
"PLAYCANVAS_PROJECT_ID": 721733
}
And did the same thing with two empty folders, switching the PLAYCANVAS_TARGET_DIR
several times and going through the pcsync pullAll
, pcwatch
process with no issues either
@zachpeterpaul Is there any caching of files/synced files/etc for pcsync that we could try to clear out here?
Spoke to Zach and there's no state for pc-sync that it stores.
@jelling You did mention in a DM that your company has some IT policies in place and we were wondering if the new target directory was preventing pcwatch from traversing the directory structure? Could you try a different target directory that is similar to the previous?
If you changed the target directory back to the original path, does it work or gives the same error?
Reproduced with configs that the client has given me
The issue was caused by the final pipe | in PLAYCANVAS_BAD_FOLDER_REG in the provided config file, which made the regex match everything. With it removed, both sync and watch should work correctly with that project. There are PLAYCANVAS_DRY_RUN and PLAYCANVAS_VERBOSE env vars for checking what gets matched by current config regex's
Confirmed fixed by OP
pcwatch
has stopped working for me after changing PLAYCANVAS_TARGET_DIR to a new dir. Rebooting and reinstallingplaycanvas-sync
also has not fixed the issue.Here's the log: