Skip to content

Support %p placeholder for project name in command strings#1977

Open
bbatsov wants to merge 1 commit intomasterfrom
feature/1698-project-name-placeholder
Open

Support %p placeholder for project name in command strings#1977
bbatsov wants to merge 1 commit intomasterfrom
feature/1698-project-name-placeholder

Conversation

@bbatsov
Copy link
Owner

@bbatsov bbatsov commented Feb 15, 2026

Summary

  • All project command strings (configure, compile, test, run, install, package) now support %p as a placeholder that gets replaced with the project name at execution time
  • The substitution happens in projectile--run-project-cmd so it works for both registered project type commands and user-entered commands
  • Updated docstrings for projectile-register-project-type and projectile--run-project-cmd

Closes #1698

Example usage

(projectile-register-project-type 'my-docker-project '("Dockerfile")
  :compile "docker build -t %p ."
  :run "docker run %p"
  :test "docker exec %p make test")

Test plan

  • Register a project type with %p in command strings
  • Run projectile-compile-project — verify %p is replaced with the project name
  • Run projectile-test-project — verify %p substitution works
  • Enter a command manually with %p at the prompt — verify it's replaced
  • Commands without %p are unaffected

Closes #1698

All project command strings (configure, compile, test, run, install,
package) now support %p as a placeholder that gets replaced with the
project name at execution time. This is useful for commands like
"docker exec %p make test" where the container name matches the
project name.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature request: provide project-name placeholder (e.g. %p) at project-type definitions

1 participant

Comments