Skip to content

Commit

Permalink
allow for author to be respected
Browse files Browse the repository at this point in the history
  • Loading branch information
Miłosz Thiede committed Feb 11, 2024
1 parent 5514e3d commit 8e58b93
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CONTRIBIUTIG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Contribiuting to some-css

In order to contribiute you should fork this repo and on your fork create a new branch, save your changes there. Minifying is done automatically when merged, no need for it. When creating a pull request, your CSS is automatically checked for errors. When creating your style, make sure you name the file something useful, like `qwant-hide-sidepanel.css`. Include at least two lines of description for your style eg. when does it activate and when does it change. You may (and should) include URLs. Don't forget the license header!
In order to contribiute you should fork this repo and on your fork create a new branch, save your changes there. Minifying is done automatically when merged, no need for it manually. When creating a pull request, your CSS is automatically checked for errors. Make sure you name your style file something useful, like `qwant-hide-sidepanel.css`. Include at least two lines of description for your style eg. when does it activate and when does it change. You may (and should) include URLs. Don't forget the license header (add your name there)!
1 change: 0 additions & 1 deletion TODO
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
- autodetect the author of style for minify, dont slap my name on everything
6 changes: 4 additions & 2 deletions minify.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
license_header=$(
cat <<- "EOF"
/* Some CSS: https://github.com/MajliTech/some-css */
/* Copyright (C) 2024 MajliTech */
/* Copyright (C) 2024 (author) */
/* */
/* This program is free software: you can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
Expand All @@ -38,6 +38,8 @@ mkdir -p min-css
for file in css/*.css; do
filename=$(basename "$file" .css)
minified_css="\n\n$(minify $file)"
printf "$license_header$minified_css" > min-css/$filename.min.css
author=$(grep -RoP 'Copyright \(C\) 2024 (\K[^ ]+)' "$file" | sed 's/^[0-9]*://')
header_authored=$(echo "$license_header" | sed "s/(author)/$author/")
printf "$header_authored$minified_css" > min-css/$filename.min.css
echo "MINIFIED: '$file' > 'min-css/$filename.min.css'"
done

0 comments on commit 8e58b93

Please sign in to comment.