exclude .min.css from being copy + include css files that don't start with theme in there name! #52

Merged
meaz merged 1 commit from theme_css_name into staging 2024-07-30 18:21:57 +02:00

View file

@ -42,8 +42,9 @@
- name: "[THEME] - Find css files from different repos"
find:
paths: "{{ forgejo_theme_dir }}"
patterns: "*.css"
patterns: ".*(?<!\\.min)\\.css$"
recurse: yes
use_regex: yes
register: css_files
tags: theme
@ -53,6 +54,7 @@
dest: "{{ forgejo_theme_dir }}/public/assets/css/"
remote_src: yes
force: yes
mode: '0644'
with_items: "{{ css_files.files }}"
when: "'/public/' not in item.path"
become: true
@ -63,7 +65,7 @@
# Lastly, update app.ini by adding the theme's name list.
- name: "[THEME] - Get and prepare a list for app.ini of css files in public folder, register it"
shell:
cmd: ls "{{ forgejo_theme_dir }}/public/assets/css" | sed -e 's/theme-//g' | sed -e 's/.css//g' | paste -s -d,
cmd: ls "{{ forgejo_theme_dir }}/public/assets/css" | awk '{ if ($0 ~ /^theme-/) { gsub(/^theme-/, "", $0) }; gsub(/.css$/, "", $0); print }' | paste -s -d,
chdir: "{{ forgejo_theme_dir }}"
register: theme_name
tags: theme