playcanvas / playcanvas-sync

Real-time synchronization of files between PlayCanvas and your local machine
https://playcanvas.com/
MIT License
75 stars 18 forks source link

Error: Missing config variable: PLAYCANVAS_API_KEY #5

Closed Christopher-Hayes closed 4 years ago

Christopher-Hayes commented 4 years ago

Just started trying to use this tool and I'm getting this error that the api key is missing from the config. But, I definitely have the the api key in the config. I took the config from the README and just altered the values to match the ones for my project.

.pcconfig

 {                                                                                                                                                                                       
    "PLAYCANVAS_BRANCH_ID": "<branch id>",                                                                                                                       
    "PLAYCANVAS_PROJECT_ID": <project integer ID>,                                                                                                                                                      
    "PLAYCANVAS_TARGET_DIR": "<absolute path to files dir>",                                                                                           
    "PLAYCANVAS_API_KEY": "<api key generated by PlayCanvas>",                                                                                                                             
    "PLAYCANVAS_BAD_FILE_REG": "^\\.|~$",                                                                                                                                                 
    "PLAYCANVAS_BAD_FOLDER_REG": "\\."                                                                                                                                                    
  }

I tried setting an environment variable instead like the README said was possible, still no luck. Any ideas?

Platform: Ubuntu 20.04 NPM: 6.13.4 Node: 13.7.0

Christopher-Hayes commented 4 years ago

Oh, wait nvm. I was using .pcconfig in the target directory when pcconfig.json is supposed to be used. I guess a notice that the config file wasn't found might be a helpful warning for future users since the error about not finding the api key config had me assuming it was finding the config file just fine.

slimbuck commented 4 years ago

I've logged an issue @Christopher-Hayes, thanks for reporting!