Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add PostBuildCommand #1301

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

romanstingler
Copy link

@romanstingler romanstingler commented Dec 16, 2024

I have implemented the post-build command feature. Here's what I did:

  1. Added post-build command parsing in command_line.rs:

    • Added handling for the --post-build-command argument
    • The argument requires a value which will be stored in config.post_build_command
  2. Created a post_build_command function in install.rs:

    • Similar to pre_build_command, it executes a shell command after successful package build
    • The command has access to PKGBASE and VERSION environment variables
    • The command runs in the package build directory
  3. Added post-build command execution in install.rs:

    • Called post_build_command after a successful package build
    • Only executes if a post-build command is configured
  4. Added post-build command config in config.rs:

    • Added PostBuildCommand option to the config file parser
    • The command can be specified in the config file under the [bin] section

Users can specify a post-build command in these ways:

  1. Via command line: paru --post-build-command "your-command"
  2. OR Via config file:
[bin]
PostBuildCommand = your-command

The command will receive:

  • Current working directory set to the package build directory
  • PKGBASE: The base package name
  • VERSION: The package version

Tested with
cargo run -- -S vim-git --post-build-command "/tmp/code/paru/test.sh"
and
paru.conf

#
# Binary OPTIONS
#
[bin]
PostBuildCommand = "/tmp/code/paru/test.sh"

closes #1300

Waiting for feedback where to place
post_build_command(config, dir, base.package_base(), &version)?;

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] Implement PostBuildCommand
1 participant