✨ Upgraded seo, made dependencycheck its own func
This commit is contained in:
parent
26ea15a216
commit
f88adb2691
2 changed files with 41 additions and 1 deletions
37
scripts/dependencycheck.sh
Executable file
37
scripts/dependencycheck.sh
Executable file
|
|
@ -0,0 +1,37 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Error handling
|
||||
set -e
|
||||
|
||||
# For styling/colorizing output
|
||||
txtbld=$(tput bold)
|
||||
# txtblue=${txtbld}$(tput setaf 4)
|
||||
# txtgreen=${txtbld}$(tput setaf 2)
|
||||
txtred=${txtbld}$(tput setaf 1)
|
||||
# txtyellow=${txtbld}$(tput setaf 3)
|
||||
txtwhite=${txtbld}$(tput setaf 7)
|
||||
|
||||
# Dependency check
|
||||
function dependencycheck()
|
||||
{
|
||||
# lady is just for demo purposes
|
||||
dependencies=("xclip" "git" "lady")
|
||||
numdependencies=3
|
||||
missingdependencies=0
|
||||
for ((i = 0; i < numdependencies; i++)) ;
|
||||
do
|
||||
if ! command -v "${dependencies[$i]}" &> /dev/null
|
||||
then
|
||||
echo "${txtred}dependency not met: ${dependencies[$i]}${txtwhite}"
|
||||
missingdependencies=$((missingdependencies+1))
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
#invoke function
|
||||
dependencycheck
|
||||
|
||||
if [ $missingdependencies -gt 0 ] ; then
|
||||
echo "${txtred}Please install needed dependencies${txtwhite}"
|
||||
exit 1
|
||||
fi
|
||||
|
|
@ -1,3 +1,6 @@
|
|||
#!/bin/sh
|
||||
|
||||
seoanalyze https://"${1}" --output-format html > seo.html && links seo.html
|
||||
# grabs the url before the .com or .org, etc
|
||||
url=$(echo "${1}" | sed 's/\..*$//')
|
||||
|
||||
seoanalyze https://"${1}" --output-format html > "${url}".html && links "${url}".html
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue