Skip to content

Commit

Permalink
đź‘· Update addCopyright CI for .php ext
Browse files Browse the repository at this point in the history
  • Loading branch information
NoaSecond committed May 30, 2024
1 parent 2c0607c commit fa1b3ab
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions utils/addCopyright.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@

# Configurations des commentaires pour chaque type de fichier
comments = {
'.php': {
'default': "\n\n<!-- Développé avec ❤️ par : www.noasecond.com. -->",
'html': "\n\n<!-- Développé avec ❤️ par : www.noasecond.com. -->"
},
'.php': "\n\n<!-- Développé avec ❤️ par : www.noasecond.com. -->",
'.js': "\n\n// Développé avec ❤️ par : www.noasecond.com.",
'.html': "\n\n<!-- Développé avec ❤️ par : www.noasecond.com. -->",
'.yml': "\n\n# Développé avec ❤️ par : www.noasecond.com.",
Expand Down Expand Up @@ -52,16 +49,7 @@ def main():
file_path = os.path.join(root, file)
if file.endswith(extensions) and not should_exclude(file_path):
ext = os.path.splitext(file)[1]
if ext == '.php':
# Read the file to determine if it contains HTML
with open(file_path, 'r') as f:
content = f.read()
if '<' in content and '>' in content:
comment = comments['.php']['html']
else:
comment = comments['.php']['default']
else:
comment = comments[ext]
comment = comments[ext]
add_comment_to_file(file_path, comment)

if __name__ == "__main__":
Expand Down

0 comments on commit fa1b3ab

Please sign in to comment.