premake / premake/premake-core

Add copy token that creates non-existing parent directories

Open
#820 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement help wanted
Dominant language
C
Stars
3.6k
Forks
654
Avg merge
1d 1h
Merged PRs (30d)
13

Description

Previously, premake allowed to do something like this on Windows:

postbuildcommands {
  "{COPY} %{wks.location}premake5.lua %{wks.location}this/does/not/exist/"
}

...and it created the parent folders like mkdir -p does on Linux.

We relied on that "feature", but since premake automatically omits trailing slashes now, it results in an error. This is probably intended and always behaved like that on Linux, but I think it's actually a pretty handy feature and might make sense to be officially re-introduced on all platforms.

If adding it to {{COPY}} breaks something, I suggest introducing {{COPYP}} or similar instead.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the implementation of the {COPY} command used by postbuildcommands, especially its handling of trailing slashes on Windows and Linux. Compare the existing platform behavior and check whether the proposed {COPY} change or a separate {COPYP} command fits better. Done means the documented command consistently creates missing parent directories across the supported platforms, with regressions covered by the relevant tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, lua
Domain
build-system
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.