Skip to content

Conversation

@pabs3
Copy link
Contributor

@pabs3 pabs3 commented Jan 19, 2026

No description provided.


test -n "$DEBUG" && sort -nr "$DEBUG"

rm -f "$DEBUG" "$MERGED_LOG"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the -d flag is not provided, $DEBUG is empty. rm -f "" exits with code 1. Since this is the final command, the script returns a failure status.

fi; \
if [ "$$should_install" = 'yes' ]; then \
echo "... installing $(COMMAND)"; \
head -1 bin/$(COMMAND) > $(TEMPFILE); \
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about building the script content in a subshell and redirecting it directly to the destination? This avoids mktemp, chmod on temp files from the beginning.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe something like this?

  • source the helper/ scripts rather than embedding them
    • add the source command to each script in bin/
  • install the helper/ scripts in /usr/share/git-extras/helper or similar
  • separate out a build target from the install target
  • build each of the to-be-installed scripts in a pattern rule that would just add the install path for the helper/ scripts.

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.

3 participants