Skip to content

Commit 92c9925

Browse files
committed
installation and execution scripts. Fixes alx-tools#8
1 parent 89ee8e6 commit 92c9925

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

install.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/usr/bin/env bash
2+
# This script installs the w3c_validator python script by moving the
3+
# w3c_validator.py and w3c_validator to the /usr/bin folder
4+
# so that the w3c_validator script can be executed from anywhere.
5+
6+
# Check if the script is executed with root privileges
7+
if [[ $EUID -ne 0 ]]; then
8+
echo "Error: This script must be run with root privileges."
9+
exit 1
10+
fi
11+
12+
# Move w3c_validator.py and w3c_validator to /usr/bin
13+
mv "./w3c_validator.py" "/usr/bin"
14+
mv "./w3c_validator" "/usr/bin"
15+
16+
echo "Installation complete. To use the w3c_validator, simply run the command:"
17+
echo "w3c_validator file [files]"

w3c_validator

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/usr/bin/env bash
2+
# calls the w3c_validator.py and passes the arguments
3+
# to it
4+
5+
if [ -e "./w3c_validator.py" ]; then
6+
python3 "./w3c_validator.py" "$@"
7+
else
8+
echo "Error: w3c_validator.py not found"
9+
fi

0 commit comments

Comments
 (0)