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

Do not source orphaned sh files #61

Merged
merged 5 commits into from
Sep 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions USAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,15 +94,17 @@ The following script does that. Add it to your shell startup file (`*rc`):
# the way shell sub-processes work. This is a work around by running
# Tinty through a function and then executing the shell scripts.
tinty_source_shell_theme() {
newer_file=$(mktemp)
tinty $@
subcommand="$1"

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

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

unset tinty_data_dir
fi
Expand Down
Loading