Skip to content

Conversation

@paulodiovani
Copy link
Contributor

Description

The usage instructions to source hook scripts to allow setting env vars search for *.sh files, but those scripts are actually symbolic links, thus the find command never fins any and the function does not work.

by replacing -type f with -type l the function works.

Alternative script

I myself simplify this script by simply redefining the tinty command with a function, so there is no need for the alias:

tinty() {
  newer_file=$(mktemp)
  command tinty $@
  subcommand="$1"

  if [ "$subcommand" = "apply" ] || [ "$subcommand" = "init" ]; then
    tinty_data_dir="${XDG_DATA_HOME:-$HOME/.local/share}/tinted-theming/tinty"

    while read -r script; do
      # shellcheck disable=SC1090
      . "$script"
    done < <(find "$tinty_data_dir" -maxdepth 1 -type l -name "*.sh" -newer "$newer_file")

    unset tinty_data_dir
  fi

  unset subcommand
}

@paulodiovani paulodiovani requested a review from a team as a code owner August 8, 2025 17:14
@paulodiovani paulodiovani requested review from JamyGolden and removed request for a team August 8, 2025 17:14
Copy link
Member

@JamyGolden JamyGolden left a comment

Choose a reason for hiding this comment

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

Thanks for the PR. How about changing this so that it finds both symlinks and normal files because there is a change the files aren't symlinks too.

Co-authored-by: Jamy <[email protected]>
@JamyGolden JamyGolden merged commit ea44433 into tinted-theming:main Aug 15, 2025
4 of 5 checks passed
@paulodiovani paulodiovani deleted the docs/update-usage branch August 18, 2025 12:55
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.

2 participants