Compare commits

..

3 Commits

8 changed files with 155 additions and 147 deletions

View File

@@ -13,11 +13,13 @@ if [ -z "${FILENAME}" ]; then
FILENAME=$DIRECTORY FILENAME=$DIRECTORY
fi fi
FILENAME=${FILENAME} \ FILENAME=$(
${FILENAME} \
| tr '/' _ \ | tr '/' _ \
| iconv -t ascii//TRANSLIT \ | iconv -t ascii//TRANSLIT \
| sed -r s/[^a-zA-Z0-9]+/_/g \ | sed -r s/[^a-zA-Z0-9]+/_/g \
| sed -r s/^_+\|-+$//g | sed -r s/^_+\|-+$//g
)
TIMESTAMP=$(date "+%Y%m%d_%H%M%S") TIMESTAMP=$(date "+%Y%m%d_%H%M%S")
FILENAME_TIMESTAMP="${FILENAME}_${TIMESTAMP}" FILENAME_TIMESTAMP="${FILENAME}_${TIMESTAMP}"

View File

@@ -10,6 +10,14 @@ $fsCharLenght = 0;
$quota = shell_exec("quota -w"); $quota = shell_exec("quota -w");
/**
* Pad string
*
* @param string $i Input string
* @param int $n Length
* @param string $p Padding string
* @return string
*/
function pad($i, $n = 3, $p = ' ') function pad($i, $n = 3, $p = ' ')
{ {
return str_pad($i, $n, $p, STR_PAD_LEFT); return str_pad($i, $n, $p, STR_PAD_LEFT);

View File

@@ -4,7 +4,8 @@
# shellcheck source="shared.sh" # shellcheck source="shared.sh"
source "$HOME/.dotfiles/scripts/shared.sh" source "$HOME/.dotfiles/scripts/shared.sh"
have php && { ! have php && msg_err "PHP Not Available, cannot install composer" && exit 0;
EXPECTED_CHECKSUM="$(php -r 'copy("https://composer.github.io/installer.sig", "php://stdout");')" EXPECTED_CHECKSUM="$(php -r 'copy("https://composer.github.io/installer.sig", "php://stdout");')"
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
ACTUAL_CHECKSUM="$(php -r "echo hash_file('sha384', 'composer-setup.php');")" ACTUAL_CHECKSUM="$(php -r "echo hash_file('sha384', 'composer-setup.php');")"
@@ -20,4 +21,4 @@ have php && {
rm composer-setup.php rm composer-setup.php
mv composer.phar ~/.local/bin/composer mv composer.phar ~/.local/bin/composer
exit $RESULT exit $RESULT
} || msg_err "PHP Not Available, cannot install composer"

View File

@@ -4,7 +4,10 @@
# shellcheck source="shared.sh" # shellcheck source="shared.sh"
source "$HOME/.dotfiles/scripts/shared.sh" source "$HOME/.dotfiles/scripts/shared.sh"
have gh && { ! have gh \
&& msg_err "gh (GitHub Client) could not be found, please install it first" \
&& exit 0;
extensions=( extensions=(
# GitHub CLI extension for generating a report on repository dependencies. # GitHub CLI extension for generating a report on repository dependencies.
andyfeller/gh-dependency-report andyfeller/gh-dependency-report
@@ -39,7 +42,4 @@ have gh && {
done done
msg_ok "Done" msg_ok "Done"
}
! have gh \
&& msg_err "gh (GitHub Client) could not be found, please install it first"

View File

@@ -4,7 +4,8 @@
# shellcheck source=shared.sh # shellcheck source=shared.sh
source "$HOME/.dotfiles/scripts/shared.sh" source "$HOME/.dotfiles/scripts/shared.sh"
have go && { ! have go && msg "go hasn't been installed yet." && exit 0;
packages=( packages=(
# sysadmin/scripting utilities, distributed as a single binary # sysadmin/scripting utilities, distributed as a single binary
github.com/skx/sysbox@latest github.com/skx/sysbox@latest
@@ -36,6 +37,4 @@ have go && {
done done
msg_ok "Done" msg_ok "Done"
}
! have go && msg "go hasn't been installed yet."

View File

@@ -4,7 +4,8 @@
# shellcheck source=shared.sh # shellcheck source=shared.sh
source "$HOME/.dotfiles/scripts/shared.sh" source "$HOME/.dotfiles/scripts/shared.sh"
have npm && { ! have npm && msg_err "npm could not be found." && exit 0;
packages=( packages=(
# This is a tool to check if your files consider your .editorconfig rules. # This is a tool to check if your files consider your .editorconfig rules.
"editorconfig-checker" "editorconfig-checker"
@@ -40,6 +41,4 @@ have npm && {
msg_run "Upgrading all global packages" msg_run "Upgrading all global packages"
npm -g --no-progress --no-timing --no-fund outdated npm -g --no-progress --no-timing --no-fund outdated
npm -g --no-timing --no-fund upgrade npm -g --no-timing --no-fund upgrade
}
! have npm && msg_err "npm could not be found."

View File

@@ -6,9 +6,8 @@
source "$HOME/.dotfiles/scripts/shared.sh" source "$HOME/.dotfiles/scripts/shared.sh"
set -e set -e
have ntfy && msg "ntfy already installed" have ntfy && msg "ntfy already installed" && exit 0;
! have ntfy && {
case $(dfm check arch) in case $(dfm check arch) in
Linux) Linux)
NTFY_ARCH="linux_$(arch)" NTFY_ARCH="linux_$(arch)"
@@ -34,4 +33,4 @@ have ntfy && msg "ntfy already installed"
fi fi
rm -rf "${NTFY_DEST}" "${NTFY_DEST}.tar.gz" rm -rf "${NTFY_DEST}" "${NTFY_DEST}.tar.gz"
}