Sublime Forum

Trouble setting build system working dir

#1

I have been running an build system in sublime that uses the project folder as the working dir to build in.

Recently I moved the sublime project file two levels up to a more common location for organisational purposes. Now my build system is broken.

My original working dir was set as…

"working_dir": "${project_path:${folder}}"

I have changed it to…

"working_dir": "$project_path/Foo/Bar"

to drill down two directories to the original working dir. When I run my build system now, it just hangs and the console output is blank…

0 Likes

#2

I would check the Sublime console (Ctrl+` or View > Show Console) to see if an error is being displayed there or not that might point out the cause of the problem. I did some tests locally with a build system of:

{
    "shell_cmd": "pwd",
    "working_dir": "${project_path}/assets"
}

This works overall and the build output would be the expected path. The only cases I could find in which it didn’t work are:

  1. The window didn’t have a sublime-project file associated with it (which makes project_path expand to an empty string)
  2. The window DID have a sublime-project file, but there was no sub-directory named assets inside of it.

In both cases the console popped out an error message with a FileNotFound error because the call to os.chdir() that is done internally failed.

If you see something similar that might help you diagnose what’s going awry.

Note also that I used ${project_path} here, but with some quick testing, $project_path worked as well.

1 Like

#3

If you want to build in the folder that you added to the project, just use $folder.

1 Like