bdkjones / CodeKit

CodeKit 3 Issue Tracker
https://codekitapp.com
82 stars 5 forks source link

Custom output paths messed up when changing build folder path #473

Open chris-scheurle opened 6 years ago

chris-scheurle commented 6 years ago

Quick, short summary: When changing the build folder path, files with a custom output path end up with output path [new build directory / [old build direcory, relative to project directory] / [custom filename]

Expected results: output path [new build directory] / [custom filename]

Actual results: see above

Exact steps to reproduce:

Expected response Please, fix this quickly, I just spent an hour fixing the paths of like 60 .jade->.svg files in a project with 3 html pages :sweat:

bdkjones commented 6 years ago

When using build folders, you really want to avoid custom output paths and, instead, have files mirror their input path into the build folder. That way, when you change things, everything comes along for the ride. Once you set a custom output path, CodeKit “locks” to that path and when you change the build folder, it simply appends that output path to the build folder because you told it, “I really want this file to be put HERE, goddammit.” You can undo this behavior by unlocking the output path (click the lock icon next to it until it’s open).

Sent from my iPhone

On Jul 7, 2018, at 11:23, Chris notifications@github.com wrote:

Quick, short summary: When changing the build folder path, files with a custom output path end up with output path [new build directory / [old build direcory, relative to project directory] / [custom filename]

Expected results: output path [new build directory] / [custom filename]

Actual results: see above

Exact steps to reproduce:

create codekit project set build folder to 'httpdocs' create file 'favicon.jade' set custom output path to 'httpdocs/resources/favicon.svg' change build path to 'httpdocs/new' take a look at favicons.jade's output path ('httpdocs/new/httpdocs/resources/favicon.svg') Expected response Please, fix this quickly, I just spent an hour fixing the paths of like 60 .jade->.svg files in a project with 3 html pages 😓

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

chris-scheurle commented 6 years ago

@bdkjones wrote:

When using build folders, you really want to avoid custom output paths and, instead, have files mirror their input path into the build folder.

It'd love to do that. Unfortunately, currently there is no way to tell pug to set the output filename based on the doctype actually produced (e.g. .svg, .xml).

I tried naming the input files like some-icon.svg.jade and setting the output filename pattern to * (meaing: 'original filename without the .jade suffix'), but CodeKit does'nt accept that.

So, I have to set the output path to change the output filepath.

@bdkjones wrote:

it simply appends that output path to the build folder because you told it, “I really want this file to be put HERE, goddammit.”

Well, that really is what I told CodeKit, but prepending the new build folder's path doesn't do that:

/SOURCE/some-file.jade    ->    /some-path-not-in-build-folder/some-file.html
/SOURCE/some-icon.jade    ->    /BUILD/gfx/some-icon.svg

should change to (old build path replaced by new one)

/SOURCE/some-file.jade    ->    /some-path-not-in-build-folder/some-file.html
/SOURCE/some-icon.jade    ->    /NEW_BUILD/gfx/some-icon.svg

not to (new build path prepended)

/SOURCE/some-file.jade    ->    /NEW_BUILD/some-path-now-in-build-folder/some-file.html
/SOURCE/some-icon.jade    ->    /NEW_BUILD/BUILD/gfx/some-icon.svg

Do you see what I mean? I can think of no example, where the current behaviour makes any sense, whereas the one I propose (i.m.h.o) would. :confused:

bdkjones commented 6 years ago

Please post a small demo project and an exact set of steps to reproduce the issue so I can walk through it over here. Thanks.

chris-scheurle commented 6 years ago

Thanks!

The steps are in readme.html (had to fill the project with something)

codekit-demo.zip