dev: Rename tools directory to scripts (#5035)
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
# scripts
|
||||
|
||||
This directory contains scripts that may be useful for a contributor to run while working on Chatterino
|
||||
Executable
+3
@@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
|
||||
docker build -f .docker/Dockerfile.build -t chatterino-ubuntu-build .docker
|
||||
Executable
+21
@@ -0,0 +1,21 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -eu
|
||||
|
||||
fail="0"
|
||||
|
||||
clang-format --version
|
||||
|
||||
while read -r file; do
|
||||
if ! diff -u <(cat "$file") <(clang-format "$file"); then
|
||||
echo "$file differs!!!!!!!"
|
||||
fail="1"
|
||||
fi
|
||||
done < <(find src/ -type f \( -iname "*.hpp" -o -iname "*.cpp" \))
|
||||
|
||||
if [ "$fail" = "1" ]; then
|
||||
echo "At least one file is poorly formatted - check the output above"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Everything seems to be formatted properly! Good job"
|
||||
Executable
+22
@@ -0,0 +1,22 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -eu
|
||||
|
||||
fail="0"
|
||||
|
||||
dos2unix --version
|
||||
|
||||
while read -r file; do
|
||||
num_dos_line_endings=$(dos2unix -id "$file" | awk '/[0-9]+/{print $(NF-1)}')
|
||||
if [ "$num_dos_line_endings" -gt "0" ]; then
|
||||
>&2 echo "File '$file' contains $num_dos_line_endings DOS line-endings, it should only be using unix line-endings!"
|
||||
fail="1"
|
||||
fi
|
||||
done < <(find src/ -type f \( -iname "*.hpp" -o -iname "*.cpp" \))
|
||||
|
||||
if [ "$fail" = "1" ]; then
|
||||
>&2 echo "At least one file is not using unix line-endings - check the output above"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
>&2 echo "Every file seems to be using unix line-endings. Good job!"
|
||||
Executable
+10
@@ -0,0 +1,10 @@
|
||||
#!/bin/bash
|
||||
|
||||
read -p "Are you sure you want to run clang-format on all source files? (y/n) " -n 1 -r
|
||||
echo
|
||||
if [[ $REPLY =~ ^[Yy]$ ]]; then
|
||||
find src/ \( -iname "*.hpp" -o -iname "*.cpp" \) -exec clang-format -i {} \;
|
||||
find tests/src/ \( -iname "*.hpp" -o -iname "*.cpp" \) -exec clang-format -i {} \;
|
||||
find benchmarks/src/ \( -iname "*.hpp" -o -iname "*.cpp" \) -exec clang-format -i {} \;
|
||||
find mocks/include/ \( -iname "*.hpp" -o -iname "*.cpp" \) -exec clang-format -i {} \;
|
||||
fi
|
||||
Executable
+13
@@ -0,0 +1,13 @@
|
||||
#!/bin/sh
|
||||
|
||||
#Download the official list of active TLDs from IANA
|
||||
#Remove the first line that contains data not needed.
|
||||
#Put everything that can be into lowercase.
|
||||
#Output the result to a file.
|
||||
curl -s 'https://data.iana.org/TLD/tlds-alpha-by-domain.txt' | sed -e '1d' -e 's/\(.*\)/\L\1/' > tlds.txt
|
||||
|
||||
#Get the TLDs in punycode format.
|
||||
#Convert the punycode to Unicode.
|
||||
#Append the results to the current file.
|
||||
sed -n -e '/^xn--/p' tlds.txt | idn2 -d >> tlds.txt
|
||||
mv tlds.txt ../resources/tlds.txt
|
||||
Executable
+2
@@ -0,0 +1,2 @@
|
||||
#!/bin/bash
|
||||
wget https://raw.githubusercontent.com/iamcal/emoji-data/master/emoji.json -O ../resources/emoji.json
|
||||
+1
@@ -0,0 +1 @@
|
||||
find . -not -path "*.git*" -exec fsutil.exe file setCaseSensitiveInfo {} disable \;
|
||||
Reference in New Issue
Block a user