Search code examples
command-line-interfaceplatform.sh

How to I get project code using Platform.sh?


I've inherited a project on Platform.sh. I need to get the project's code on my local machine.

Using the Platform CLI, I tried platform project:get [project-id], but it keeps telling me that the project is already mapped to my user's root directory.

I can't navigate up one level and run it elsewhere since it says that the "already mapped" path is the root. I also cannot find any files related to the project.

How do I get these project files onto my machine?


Solution

  • Using the Platform CLI, I tried platform project:get [project-id], but it keeps telling me that the project is already mapped to my user's root directory.

    My guess is that you accidentally mapped the project when you were in your home directory. You didn't mention which OS you are on but in your home directory, as @zstolar indicated, there should be a hidden directory named .platform. Inside of that directory, among other things that you do not want to delete is most likely a directory named local. Inside of that directory will be a file named project.yaml. Delete the local directory, and the project.yaml file inside of it. Navigate to where you want to store the site's source code, run platform get [project-id] and now it should ask for the name of the directory to download the site code into.

    If you're on windows let me know; I believe the location is slightly different and will have to look it up.