mirror of
https://github.com/ivuorinen/dotfiles.git
synced 2026-03-10 20:02:59 +00:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e7578e4905 | |||
| 3fce0ac4dc |
@@ -13,11 +13,13 @@ if [ -z "${FILENAME}" ]; then
|
||||
FILENAME=$DIRECTORY
|
||||
fi
|
||||
|
||||
FILENAME=${FILENAME} \
|
||||
FILENAME=$(
|
||||
${FILENAME} \
|
||||
| tr '/' _ \
|
||||
| iconv -t ascii//TRANSLIT \
|
||||
| sed -r s/[^a-zA-Z0-9]+/_/g \
|
||||
| sed -r s/^_+\|-+$//g
|
||||
)
|
||||
|
||||
TIMESTAMP=$(date "+%Y%m%d_%H%M%S")
|
||||
FILENAME_TIMESTAMP="${FILENAME}_${TIMESTAMP}"
|
||||
|
||||
@@ -10,6 +10,14 @@ $fsCharLenght = 0;
|
||||
|
||||
$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 = ' ')
|
||||
{
|
||||
return str_pad($i, $n, $p, STR_PAD_LEFT);
|
||||
|
||||
@@ -4,7 +4,8 @@
|
||||
# shellcheck source="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");')"
|
||||
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
|
||||
ACTUAL_CHECKSUM="$(php -r "echo hash_file('sha384', 'composer-setup.php');")"
|
||||
@@ -20,4 +21,4 @@ have php && {
|
||||
rm composer-setup.php
|
||||
mv composer.phar ~/.local/bin/composer
|
||||
exit $RESULT
|
||||
} || msg_err "PHP Not Available, cannot install composer"
|
||||
|
||||
|
||||
@@ -4,7 +4,10 @@
|
||||
# shellcheck source="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=(
|
||||
# GitHub CLI extension for generating a report on repository dependencies.
|
||||
andyfeller/gh-dependency-report
|
||||
@@ -39,7 +42,4 @@ have gh && {
|
||||
done
|
||||
|
||||
msg_ok "Done"
|
||||
}
|
||||
|
||||
! have gh \
|
||||
&& msg_err "gh (GitHub Client) could not be found, please install it first"
|
||||
|
||||
@@ -4,7 +4,8 @@
|
||||
# shellcheck source=shared.sh
|
||||
source "$HOME/.dotfiles/scripts/shared.sh"
|
||||
|
||||
have go && {
|
||||
! have go && msg "go hasn't been installed yet." && exit 0;
|
||||
|
||||
packages=(
|
||||
# sysadmin/scripting utilities, distributed as a single binary
|
||||
github.com/skx/sysbox@latest
|
||||
@@ -36,6 +37,4 @@ have go && {
|
||||
done
|
||||
|
||||
msg_ok "Done"
|
||||
}
|
||||
|
||||
! have go && msg "go hasn't been installed yet."
|
||||
|
||||
@@ -4,7 +4,8 @@
|
||||
# shellcheck source=shared.sh
|
||||
source "$HOME/.dotfiles/scripts/shared.sh"
|
||||
|
||||
have npm && {
|
||||
! have npm && msg_err "npm could not be found." && exit 0;
|
||||
|
||||
packages=(
|
||||
# This is a tool to check if your files consider your .editorconfig rules.
|
||||
"editorconfig-checker"
|
||||
@@ -40,6 +41,4 @@ have npm && {
|
||||
msg_run "Upgrading all global packages"
|
||||
npm -g --no-progress --no-timing --no-fund outdated
|
||||
npm -g --no-timing --no-fund upgrade
|
||||
}
|
||||
|
||||
! have npm && msg_err "npm could not be found."
|
||||
|
||||
@@ -6,9 +6,8 @@
|
||||
source "$HOME/.dotfiles/scripts/shared.sh"
|
||||
set -e
|
||||
|
||||
have ntfy && msg "ntfy already installed"
|
||||
have ntfy && msg "ntfy already installed" && exit 0;
|
||||
|
||||
! have ntfy && {
|
||||
case $(dfm check arch) in
|
||||
Linux)
|
||||
NTFY_ARCH="linux_$(arch)"
|
||||
@@ -34,4 +33,4 @@ have ntfy && msg "ntfy already installed"
|
||||
fi
|
||||
|
||||
rm -rf "${NTFY_DEST}" "${NTFY_DEST}.tar.gz"
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user