mirror of
https://github.com/ivuorinen/dotfiles.git
synced 2026-02-02 14:48:10 +00:00
Compare commits
13 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| cab855380f | |||
| e7578e4905 | |||
| 3fce0ac4dc | |||
| b89213ffb5 | |||
| 823e9cc381 | |||
| 8be55a7c76 | |||
| f4fb53abaa | |||
| 66c31c3d3f | |||
| 1a8c32bf4c | |||
| 864fbc18da | |||
| b688ee7503 | |||
| 9dfb7a3c4a | |||
| 192ca6d26c |
@@ -8,6 +8,9 @@ indent_style = space
|
|||||||
insert_final_newline = true
|
insert_final_newline = true
|
||||||
trim_trailing_whitespace = true
|
trim_trailing_whitespace = true
|
||||||
|
|
||||||
|
[*.php]
|
||||||
|
indent_size = 4
|
||||||
|
|
||||||
[.git{ignore,modules}]
|
[.git{ignore,modules}]
|
||||||
indent_style = tab
|
indent_style = tab
|
||||||
indent_size = 1
|
indent_size = 1
|
||||||
|
|||||||
2
.gitignore
vendored
2
.gitignore
vendored
@@ -7,3 +7,5 @@ Brewfile.lock.json
|
|||||||
config/fzf
|
config/fzf
|
||||||
config/cheat/cheatsheets/pure-bash-bible/*
|
config/cheat/cheatsheets/pure-bash-bible/*
|
||||||
config/cheat/cheatsheets/tldr/*
|
config/cheat/cheatsheets/tldr/*
|
||||||
|
!.gitkeep
|
||||||
|
|
||||||
|
|||||||
6
.gitmodules
vendored
6
.gitmodules
vendored
@@ -1,16 +1,16 @@
|
|||||||
# vim: set expandtab:
|
# vim: set expandtab:
|
||||||
[submodule "dotbot"]
|
[submodule "dotbot"]
|
||||||
path = dotbot
|
path = tools/dotbot
|
||||||
url = https://github.com/anishathalye/dotbot.git
|
url = https://github.com/anishathalye/dotbot.git
|
||||||
ignore = dirty
|
ignore = dirty
|
||||||
|
|
||||||
[submodule "dotbot-brew"]
|
[submodule "dotbot-brew"]
|
||||||
path = dotbot-brew
|
path = tools/dotbot-brew
|
||||||
url = https://github.com/wren/dotbot-brew.git
|
url = https://github.com/wren/dotbot-brew.git
|
||||||
ignore = dirty
|
ignore = dirty
|
||||||
|
|
||||||
[submodule "dotbot-include"]
|
[submodule "dotbot-include"]
|
||||||
path = dotbot-include
|
path = tools/dotbot-include
|
||||||
url = https://gitlab.com/gnfzdz/dotbot-include.git
|
url = https://gitlab.com/gnfzdz/dotbot-include.git
|
||||||
ignore = dirty
|
ignore = dirty
|
||||||
|
|
||||||
|
|||||||
19
.markdownlint.json
Normal file
19
.markdownlint.json
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
{
|
||||||
|
"extends": "markdownlint/style/prettier",
|
||||||
|
"code-block-style": {
|
||||||
|
"style": "fenced"
|
||||||
|
},
|
||||||
|
"code-fence-style": {
|
||||||
|
"style": "backtick"
|
||||||
|
},
|
||||||
|
"heading-style": {
|
||||||
|
"style": "atx"
|
||||||
|
},
|
||||||
|
"no-duplicate-heading": {
|
||||||
|
"siblings_only": true
|
||||||
|
},
|
||||||
|
"required-headings": false,
|
||||||
|
"ul-style": {
|
||||||
|
"style": "dash"
|
||||||
|
}
|
||||||
|
}
|
||||||
5
.markdownlintignore
Normal file
5
.markdownlintignore
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
config/cheat/cheatsheets/community/
|
||||||
|
config/tmux/
|
||||||
|
config/nvim/
|
||||||
|
tools/
|
||||||
|
|
||||||
@@ -1,7 +1,8 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
git submodule add --name dotbot-brew -f https://github.com/wren/dotbot-brew.git dotbot-brew
|
git submodule add --name dotbot -f https://github.com/anishathalye/dotbot.git tools/dotbot
|
||||||
git submodule add --name dotbot-include -f https://gitlab.com/gnfzdz/dotbot-include.git dotbot-include
|
git submodule add --name dotbot-brew -f https://github.com/wren/dotbot-brew.git tools/dotbot-brew
|
||||||
|
git submodule add --name dotbot-include -f https://gitlab.com/gnfzdz/dotbot-include.git tools/dotbot-include
|
||||||
git submodule add --name cheat-community -f https://github.com/cheat/cheatsheets.git config/cheat/cheatsheets/community
|
git submodule add --name cheat-community -f https://github.com/cheat/cheatsheets.git config/cheat/cheatsheets/community
|
||||||
git submodule add --name tmux/tpm -f https://github.com/tmux-plugins/tpm.git config/tmux/plugins/tpm
|
git submodule add --name tmux/tpm -f https://github.com/tmux-plugins/tpm.git config/tmux/plugins/tpm
|
||||||
|
|
||||||
|
|||||||
18
base/nbrc
Normal file
18
base/nbrc
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
###############################################################################
|
||||||
|
# .nbrc
|
||||||
|
#
|
||||||
|
# Configuration file for `nb`, a command line note-taking, bookmarking,
|
||||||
|
# and knowledge base application with encryption, search, Git-backed syncing,
|
||||||
|
# and more in a single portable script.
|
||||||
|
#
|
||||||
|
# Edit this file manually or manage settings using the `nb settings`
|
||||||
|
# subcommand. Configuration options are set as environment variables, eg:
|
||||||
|
# export NB_ENCRYPTION_TOOL=gpg
|
||||||
|
#
|
||||||
|
# https://github.com/xwmx/nb
|
||||||
|
###############################################################################
|
||||||
|
|
||||||
|
export NB_DIR="${NB_DIR:-$HOME/.local/state/nb}" # Set by `nb` • Mon May 8 15:25:12 EEST 2023
|
||||||
|
|
||||||
|
export NB_COLOR_THEME="${NB_COLOR_THEME:-unicorn}" # Set by `nb` • Mon May 8 15:41:22 EEST 2023
|
||||||
@@ -5,6 +5,10 @@ autoload -U colors zsh/terminfo
|
|||||||
colors
|
colors
|
||||||
setopt correct
|
setopt correct
|
||||||
|
|
||||||
|
# Add completion scripts to zsh path
|
||||||
|
fpath=(~/.config/zsh/completion $fpath)
|
||||||
|
autoload -Uz compinit && compinit -i
|
||||||
|
|
||||||
# Defaults
|
# Defaults
|
||||||
export DOTFILES="$HOME/.dotfiles"
|
export DOTFILES="$HOME/.dotfiles"
|
||||||
# shellcheck source=shared.sh
|
# shellcheck source=shared.sh
|
||||||
@@ -43,4 +47,6 @@ have antigen && {
|
|||||||
# starship is present
|
# starship is present
|
||||||
have starship && eval "$(starship init zsh)"
|
have starship && eval "$(starship init zsh)"
|
||||||
|
|
||||||
[ -f "${XDG_CONFIG_HOME:-$HOME/.config}"/fzf/fzf.zsh ] && source "${XDG_CONFIG_HOME:-$HOME/.config}"/fzf/fzf.zsh
|
[ -f "${XDG_CONFIG_HOME:-$HOME/.config}"/fzf/fzf.zsh ] \
|
||||||
|
&& source "${XDG_CONFIG_HOME:-$HOME/.config}"/fzf/fzf.zsh
|
||||||
|
|
||||||
|
|||||||
0
config/cheat/cheatsheets/personal/.gitkeep
Normal file
0
config/cheat/cheatsheets/personal/.gitkeep
Normal file
0
config/cheat/cheatsheets/pure-bash-bible/.gitkeep
Normal file
0
config/cheat/cheatsheets/pure-bash-bible/.gitkeep
Normal file
0
config/cheat/cheatsheets/tldr/.gitkeep
Normal file
0
config/cheat/cheatsheets/tldr/.gitkeep
Normal file
@@ -72,6 +72,12 @@ have irssi && {
|
|||||||
x-dc "$IRSSI_CONFIG_HOME"
|
x-dc "$IRSSI_CONFIG_HOME"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# nb, https://xwmx.github.io/nb/
|
||||||
|
have nb && {
|
||||||
|
export NB_DIR="$XDG_STATE_HOME/nb"
|
||||||
|
x-dc "$NB_DIR"
|
||||||
|
}
|
||||||
|
|
||||||
# nvm, the node version manager
|
# nvm, the node version manager
|
||||||
export NVM_LAZY_LOAD=true
|
export NVM_LAZY_LOAD=true
|
||||||
export NVM_COMPLETION=true
|
export NVM_COMPLETION=true
|
||||||
@@ -80,6 +86,12 @@ export NVM_DIR="$XDG_CONFIG_HOME/nvm"
|
|||||||
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
|
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
|
||||||
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
|
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
|
||||||
|
|
||||||
|
# Add npm packages to path
|
||||||
|
have node && {
|
||||||
|
NVM_NODE_BIN_DIR="$(dirname "$(which node)")"
|
||||||
|
path_append "$NVM_NODE_BIN_DIR"
|
||||||
|
}
|
||||||
|
|
||||||
# op (1Password cli) is present
|
# op (1Password cli) is present
|
||||||
have op && {
|
have op && {
|
||||||
export OP_CACHE="$XDG_STATE_HOME/1password"
|
export OP_CACHE="$XDG_STATE_HOME/1password"
|
||||||
@@ -111,3 +123,5 @@ export GNUPGHOME="$XDG_DATA_HOME/gnupg"
|
|||||||
export SCREENRC="$XDG_CONFIG_HOME/misc/screenrc"
|
export SCREENRC="$XDG_CONFIG_HOME/misc/screenrc"
|
||||||
export TMUX_CONF="$DOTFILES/config/tmux/tmux.conf"
|
export TMUX_CONF="$DOTFILES/config/tmux/tmux.conf"
|
||||||
export BAT_THEME="ansi"
|
export BAT_THEME="ansi"
|
||||||
|
export CHEAT_USE_FZF=true
|
||||||
|
|
||||||
|
|||||||
@@ -1230,6 +1230,8 @@
|
|||||||
<string>kNextWindowPointerAction</string>
|
<string>kNextWindowPointerAction</string>
|
||||||
</dict>
|
</dict>
|
||||||
</dict>
|
</dict>
|
||||||
|
<key>PromptOnQuit</key>
|
||||||
|
<false/>
|
||||||
<key>SmartPlacement</key>
|
<key>SmartPlacement</key>
|
||||||
<true/>
|
<true/>
|
||||||
<key>SoundForEsc</key>
|
<key>SoundForEsc</key>
|
||||||
|
|||||||
Submodule config/nvim updated: d50611058c...b17ca3c324
174
config/zsh/completion/_nb
Normal file
174
config/zsh/completion/_nb
Normal file
@@ -0,0 +1,174 @@
|
|||||||
|
#compdef nb
|
||||||
|
###############################################################################
|
||||||
|
# __ _
|
||||||
|
# \ \ _ __ | |__
|
||||||
|
# \ \ | '_ \| '_ \
|
||||||
|
# / / | | | | |_) |
|
||||||
|
# /_/ |_| |_|_.__/
|
||||||
|
#
|
||||||
|
# [nb] Command line and local web note-taking, bookmarking, and archiving with
|
||||||
|
# plain text data storage, encryption, filtering and search, pinning, #tagging,
|
||||||
|
# Git-backed versioning and syncing, Pandoc-backed conversion, global and local
|
||||||
|
# notebooks, customizable color themes, [[wiki-style linking]], plugins, and
|
||||||
|
# more in a single portable, user-friendly script.
|
||||||
|
#
|
||||||
|
# https://github.com/xwmx/nb
|
||||||
|
###############################################################################
|
||||||
|
_nb_subcommands() {
|
||||||
|
# _nb_cache_completions()
|
||||||
|
#
|
||||||
|
# Usage:
|
||||||
|
# _nb_cache_completions <path>
|
||||||
|
#
|
||||||
|
# Description:
|
||||||
|
# Cache completions for `nb`. Generating completions can be slow and
|
||||||
|
# native shell caching doesn't appear to help.
|
||||||
|
_nb_cache_completions() {
|
||||||
|
local _cache_path="${1:-}"
|
||||||
|
|
||||||
|
[[ -z "${_cache_path:-}" ]] && return 0
|
||||||
|
|
||||||
|
# Remove outdated cache files.
|
||||||
|
|
||||||
|
local _base_cache_path="${_cache_path%-*}"
|
||||||
|
|
||||||
|
local __suffix=
|
||||||
|
for __suffix in "zsh" "v1"
|
||||||
|
do
|
||||||
|
if [[ -e "${_base_cache_path:?}-${__suffix:?}" ]]
|
||||||
|
then
|
||||||
|
rm -f "${_base_cache_path:?}-${__suffix:?}"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
# Rebuild completion cache.
|
||||||
|
|
||||||
|
local _commands=
|
||||||
|
IFS=$'\n' _commands=($(nb subcommands))
|
||||||
|
|
||||||
|
local _notebooks=
|
||||||
|
IFS=$'\n' _notebooks=($(nb notebooks --names --no-color --unarchived))
|
||||||
|
|
||||||
|
local _completions=()
|
||||||
|
IFS=$'\n' _completions=(${_commands[@]})
|
||||||
|
|
||||||
|
local _commands_cached=
|
||||||
|
local _notebooks_cached=
|
||||||
|
|
||||||
|
if [[ -e "${_cache_path}" ]]
|
||||||
|
then
|
||||||
|
local _counter=0
|
||||||
|
|
||||||
|
local __line=
|
||||||
|
while IFS= read -r __line
|
||||||
|
do
|
||||||
|
_counter=$((_counter+1))
|
||||||
|
|
||||||
|
if [[ "${_counter}" == 1 ]]
|
||||||
|
then
|
||||||
|
_commands_cached="${__line}"
|
||||||
|
elif [[ "${_counter}" == 2 ]]
|
||||||
|
then
|
||||||
|
_notebooks_cached="${__line}"
|
||||||
|
else
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done < "${_cache_path}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ "${_commands_cached}" != "${_commands[*]:-}" ]] ||
|
||||||
|
[[ "${_notebooks_cached}" != "${_notebooks[*]:-}" ]]
|
||||||
|
then
|
||||||
|
# Construct <notebook>:<subcommand> completions.
|
||||||
|
local __notebook=
|
||||||
|
for __notebook in "${_notebooks[@]}"
|
||||||
|
do
|
||||||
|
local __command=
|
||||||
|
for __command in "${_commands[@]}"
|
||||||
|
do
|
||||||
|
if [[ -n "${__notebook:-}" ]] &&
|
||||||
|
[[ -n "${__command:-}" ]]
|
||||||
|
then
|
||||||
|
_completions+=("${__notebook}:${__command}")
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
done
|
||||||
|
|
||||||
|
local _directory_path=
|
||||||
|
_directory_path="$(dirname "${_cache_path}")"
|
||||||
|
|
||||||
|
mkdir -p "${_directory_path}"
|
||||||
|
|
||||||
|
if [[ -f "${_cache_path:?}" ]]
|
||||||
|
then
|
||||||
|
rm -f "${_cache_path:?}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
touch "${_cache_path:?}"
|
||||||
|
|
||||||
|
{
|
||||||
|
(IFS=$' '; printf "%s\\n" "${_commands[*]}")
|
||||||
|
(IFS=$' '; printf "%s\\n" "${_notebooks[*]}")
|
||||||
|
printf "%s\\n" "${_completions[@]}"
|
||||||
|
} >> "${_cache_path}"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
local _nb_dir=
|
||||||
|
_nb_dir="$(nb env | grep 'NB_DIR' | cut -d = -f 2)"
|
||||||
|
|
||||||
|
if [[ -z "${_nb_dir:?}" ]] ||
|
||||||
|
[[ ! -e "${_nb_dir}" ]]
|
||||||
|
then
|
||||||
|
return 0
|
||||||
|
elif [[ -L "${_nb_dir}" ]]
|
||||||
|
then
|
||||||
|
if hash "realpath" 2>/dev/null
|
||||||
|
then
|
||||||
|
_nb_dir="$(realpath "${_nb_dir}")"
|
||||||
|
else
|
||||||
|
_nb_dir="$(readlink "${_nb_dir}")"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ ! -d "${_nb_dir}" ]]
|
||||||
|
then
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
local _cache_path="${_nb_dir:?}/.cache/nb-completion-cache-v2"
|
||||||
|
local _completions_cached=()
|
||||||
|
|
||||||
|
if [[ ! -e "${_cache_path}" ]]
|
||||||
|
then
|
||||||
|
_nb_cache_completions "${_cache_path}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ -e "${_cache_path}" ]]
|
||||||
|
then
|
||||||
|
local _counter=0
|
||||||
|
|
||||||
|
local __line=
|
||||||
|
while IFS= read -r __line
|
||||||
|
do
|
||||||
|
_counter=$((_counter+1))
|
||||||
|
|
||||||
|
if [[ "${_counter}" -gt 2 ]]
|
||||||
|
then
|
||||||
|
_completions_cached+=("${__line}")
|
||||||
|
fi
|
||||||
|
done < "${_cache_path}"
|
||||||
|
|
||||||
|
(_nb_cache_completions "${_cache_path}" &)
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ "${?}" -eq 0 ]]
|
||||||
|
then
|
||||||
|
compadd -- "${_completions_cached[@]}"
|
||||||
|
return 0
|
||||||
|
else
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
_nb_subcommands "$@"
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
- include: 'hosts/defaults.yaml'
|
- include: "tools/dotbot-defaults.yaml"
|
||||||
- shell:
|
- shell:
|
||||||
- echo "Configuring air"
|
- echo "Configuring air"
|
||||||
- brewfile:
|
- brewfile:
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
- include: 'hosts/defaults.yaml'
|
- include: "tools/dotbot-defaults.yaml"
|
||||||
- shell:
|
- shell:
|
||||||
- echo "Configuring lakka"
|
- echo "Configuring lakka"
|
||||||
- link:
|
- link:
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
- include: 'hosts/defaults.yaml'
|
- include: "tools/dotbot-defaults.yaml"
|
||||||
- shell:
|
- shell:
|
||||||
- echo "Configuring tunkki"
|
- echo "Configuring tunkki"
|
||||||
- link:
|
- link:
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
- include: 'hosts/defaults.yaml'
|
- include: "tools/dotbot-defaults.yaml"
|
||||||
- shell:
|
- shell:
|
||||||
- echo "Configuring v"
|
- echo "Configuring v"
|
||||||
- brewfile:
|
- brewfile:
|
||||||
|
|||||||
12
install
12
install
@@ -3,12 +3,12 @@
|
|||||||
set -e
|
set -e
|
||||||
|
|
||||||
CONFIG="install.conf.yaml"
|
CONFIG="install.conf.yaml"
|
||||||
DOTBOT_DIR="dotbot"
|
DOTBOT_DIR="tools/dotbot"
|
||||||
|
|
||||||
DOTBOT_BIN="bin/dotbot"
|
DOTBOT_BIN="bin/dotbot"
|
||||||
BASEDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
BASEDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||||
DOTBOT_BIN_PATH="${BASEDIR}/${DOTBOT_DIR}/${DOTBOT_BIN}"
|
DOTBOT_BIN_PATH="${BASEDIR}/${DOTBOT_DIR}/${DOTBOT_BIN}"
|
||||||
DOTBOT_HOST="$(hostname -s)" || ''
|
DOTBOT_HOST="$(hostname -s)"
|
||||||
|
|
||||||
cd "$BASEDIR"
|
cd "$BASEDIR"
|
||||||
git submodule sync --quiet --recursive
|
git submodule sync --quiet --recursive
|
||||||
@@ -16,8 +16,8 @@ git submodule update --init --recursive
|
|||||||
|
|
||||||
"${DOTBOT_BIN_PATH}" \
|
"${DOTBOT_BIN_PATH}" \
|
||||||
-d "${BASEDIR}" \
|
-d "${BASEDIR}" \
|
||||||
--plugin-dir=dotbot-brew \
|
--plugin-dir=tools/dotbot-brew \
|
||||||
--plugin-dir=dotbot-include \
|
--plugin-dir=tools/dotbot-include \
|
||||||
-c "${CONFIG}" \
|
-c "${CONFIG}" \
|
||||||
"${@}"
|
"${@}"
|
||||||
|
|
||||||
@@ -28,8 +28,8 @@ if [ "${DOTBOT_HOST}" != "" ]; then
|
|||||||
&& echo "(!) Found $DOTBOT_HOST_CONFIG" \
|
&& echo "(!) Found $DOTBOT_HOST_CONFIG" \
|
||||||
&& "$DOTBOT_BIN_PATH" \
|
&& "$DOTBOT_BIN_PATH" \
|
||||||
-d "$BASEDIR" \
|
-d "$BASEDIR" \
|
||||||
--plugin-dir=dotbot-brew \
|
--plugin-dir=tools/dotbot-brew \
|
||||||
--plugin-dir=dotbot-include \
|
--plugin-dir=tools/dotbot-include \
|
||||||
-c "$DOTBOT_HOST_CONFIG" \
|
-c "$DOTBOT_HOST_CONFIG" \
|
||||||
"${@}"
|
"${@}"
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
- include: "hosts/defaults.yaml"
|
- include: "tools/dotbot-defaults.yaml"
|
||||||
- clean:
|
- clean:
|
||||||
~/:
|
~/:
|
||||||
~/.config:
|
~/.config:
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ function section_install
|
|||||||
MENU=(
|
MENU=(
|
||||||
"all:Installs everything in the correct order"
|
"all:Installs everything in the correct order"
|
||||||
"antigen:Updates the antigen.zsh file"
|
"antigen:Updates the antigen.zsh file"
|
||||||
|
"cheat-databases:Install cheat external cheatsheet databases"
|
||||||
"composer:Install composer"
|
"composer:Install composer"
|
||||||
"dotenv:Install dotenv-linter"
|
"dotenv:Install dotenv-linter"
|
||||||
"gh:Install GitHub CLI Extensions"
|
"gh:Install GitHub CLI Extensions"
|
||||||
@@ -53,6 +54,7 @@ function section_install
|
|||||||
$0 install fzf
|
$0 install fzf
|
||||||
$0 install gh
|
$0 install gh
|
||||||
$0 install go
|
$0 install go
|
||||||
|
$0 install cheat-databases
|
||||||
$0 install imagick
|
$0 install imagick
|
||||||
$0 install neofetch
|
$0 install neofetch
|
||||||
$0 install nvm
|
$0 install nvm
|
||||||
@@ -64,6 +66,12 @@ function section_install
|
|||||||
curl -sSfL git.io/antigen -o "$DOTFILES/local/bin/antigen.zsh" \
|
curl -sSfL git.io/antigen -o "$DOTFILES/local/bin/antigen.zsh" \
|
||||||
&& msg_yay "New antigen installed!"
|
&& msg_yay "New antigen installed!"
|
||||||
;;
|
;;
|
||||||
|
cheat-databases)
|
||||||
|
for database in "$DOTFILES"/scripts/install-cheat-*; do
|
||||||
|
bash "$database" \
|
||||||
|
&& msg_yay "Cheat: $database run"
|
||||||
|
done
|
||||||
|
;;
|
||||||
composer)
|
composer)
|
||||||
bash "$DOTFILES/scripts/install-composer.sh" \
|
bash "$DOTFILES/scripts/install-composer.sh" \
|
||||||
&& msg_yay "composer installed!"
|
&& msg_yay "composer installed!"
|
||||||
|
|||||||
BIN
local/bin/phpcs
Executable file
BIN
local/bin/phpcs
Executable file
Binary file not shown.
@@ -13,11 +13,13 @@ if [ -z "${FILENAME}" ]; then
|
|||||||
FILENAME=$DIRECTORY
|
FILENAME=$DIRECTORY
|
||||||
fi
|
fi
|
||||||
|
|
||||||
FILENAME=${FILENAME} \
|
FILENAME=$(
|
||||||
| tr '/' _ \
|
${FILENAME} \
|
||||||
| iconv -t ascii//TRANSLIT \
|
| tr '/' _ \
|
||||||
| sed -r s/[^a-zA-Z0-9]+/_/g \
|
| iconv -t ascii//TRANSLIT \
|
||||||
| sed -r s/^_+\|-+$//g
|
| sed -r s/[^a-zA-Z0-9]+/_/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}"
|
||||||
|
|||||||
@@ -8,24 +8,24 @@ $quota = '';
|
|||||||
$output = [];
|
$output = [];
|
||||||
$fsCharLenght = 0;
|
$fsCharLenght = 0;
|
||||||
|
|
||||||
if ($debug) {
|
$quota = shell_exec("quota -w");
|
||||||
$quota = "Disk quotas for user viir (uid 2913):
|
|
||||||
Filesystem blocks quota limit grace files quota limit grace
|
|
||||||
10.0.0.89:/www/webroots/2 8277615 52428800 52428800 0 0 0
|
|
||||||
10.0.0.179:/users1/users/2 1999431 52428800 52428800 0 0 0
|
|
||||||
10.0.0.90:/siilo/2 24835106 524288000 524288000 0 0 0";
|
|
||||||
} else {
|
|
||||||
// $quota = system("quota -w");
|
|
||||||
$quota = shell_exec("quota -w");
|
|
||||||
}
|
|
||||||
|
|
||||||
function pad($i, $n = 3, $p = ' ') {
|
/**
|
||||||
|
* 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);
|
return str_pad($i, $n, $p, STR_PAD_LEFT);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($quota)) {
|
if (empty($quota)) {
|
||||||
var_dump($quota);
|
var_dump($quota);
|
||||||
die("quota was empty\n");
|
die("quota was empty\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
$quota = explode("\n", $quota);
|
$quota = explode("\n", $quota);
|
||||||
@@ -41,34 +41,34 @@ foreach ($quota as $lineNum => $line) {
|
|||||||
if (count($values) != 4) {
|
if (count($values) != 4) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
$result = array_combine(['fs', 'used', 'quota', 'limit'], $values);
|
$result = array_combine(['fs', 'used', 'quota', 'limit'], $values);
|
||||||
|
|
||||||
$result['used_percentage'] = round($result['used'] / $result['quota'] * 100, 3);
|
$result['used_percentage'] = round($result['used'] / $result['quota'] * 100, 3);
|
||||||
$result['used_gb'] = round($result['used'] / 1024 / 1024, 2);
|
$result['used_gb'] = round($result['used'] / 1024 / 1024, 2);
|
||||||
$result['quota_gb'] = round($result['quota'] / 1024 / 1024, 2);
|
$result['quota_gb'] = round($result['quota'] / 1024 / 1024, 2);
|
||||||
|
|
||||||
$char = strlen($result['fs']);
|
$char = strlen($result['fs']);
|
||||||
if ($char > $fsCharLenght) {
|
if ($char > $fsCharLenght) {
|
||||||
$fsCharLenght = $char;
|
$fsCharLenght = $char;
|
||||||
}
|
}
|
||||||
|
|
||||||
$output[] = $result;
|
$output[] = $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($output)) {
|
if (!empty($output)) {
|
||||||
|
$header = sprintf(
|
||||||
$header = sprintf("%s | %s | %s | %s",
|
"%s | %s | %s | %s",
|
||||||
str_pad("Mount", $fsCharLenght),
|
str_pad("Mount", $fsCharLenght),
|
||||||
'Usage%',
|
'Usage%',
|
||||||
'Used/Total',
|
'Used/Total',
|
||||||
'Bar'
|
'Bar'
|
||||||
);
|
);
|
||||||
$headerWidth = strlen($header);
|
$headerWidth = strlen($header);
|
||||||
|
|
||||||
echo "\n" . $header . "\n";
|
echo "\n" . $header . "\n";
|
||||||
echo str_repeat('-', $headerWidth + 24) . "\n";
|
echo str_repeat('-', $headerWidth + 24) . "\n";
|
||||||
|
|
||||||
foreach ($output as $i) {
|
foreach ($output as $i) {
|
||||||
$barUsed = round($i['used_percentage']) / 4;
|
$barUsed = round($i['used_percentage']) / 4;
|
||||||
echo sprintf(
|
echo sprintf(
|
||||||
@@ -82,4 +82,3 @@ if (!empty($output)) {
|
|||||||
|
|
||||||
echo "\n\n";
|
echo "\n\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
8
phpcs.xml
Normal file
8
phpcs.xml
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0"?>
|
||||||
|
<ruleset name="PHP_CodeSniffer">
|
||||||
|
<description>PHP_CodeSniffer configuration</description>
|
||||||
|
<rule ref="PSR12">
|
||||||
|
<exclude name="PSR12.Operators.OperatorSpacing"/>
|
||||||
|
<exclude name="PSR1.Files.SideEffects.FoundWithSymbols"/>
|
||||||
|
</rule>
|
||||||
|
</ruleset>
|
||||||
@@ -18,7 +18,9 @@ PBB_TEMP_DIR="/tmp/pbb-$(rnd)"
|
|||||||
|
|
||||||
# If there's no .git, clone the folder
|
# If there's no .git, clone the folder
|
||||||
if [ ! -d "$PBB_TEMP_DIR/.git" ]; then
|
if [ ! -d "$PBB_TEMP_DIR/.git" ]; then
|
||||||
git clone "$PBB_GIT" "$PBB_TEMP_DIR"
|
msg_run "Starting to clone $PBB_GIT"
|
||||||
|
git clone --depth 1 --single-branch -q "$PBB_GIT" "$PBB_TEMP_DIR" \
|
||||||
|
&& msg_yay "Cloned $PBB_GIT"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
PBB_CHAPTERS=$(ls -1v "$PBB_TEMP_DIR"/manuscript/chapter*)
|
PBB_CHAPTERS=$(ls -1v "$PBB_TEMP_DIR"/manuscript/chapter*)
|
||||||
@@ -32,10 +34,9 @@ for f in ${PBB_CHAPTERS[@]}; do
|
|||||||
# get all headers, take the first one, strip the # and return the first word in lowercase
|
# get all headers, take the first one, strip the # and return the first word in lowercase
|
||||||
HEADER=$(grep -e '^[#] ' "$f" | head -1 | awk '{print tolower($2)}')
|
HEADER=$(grep -e '^[#] ' "$f" | head -1 | awk '{print tolower($2)}')
|
||||||
CHEAT_FILE="$CHEAT_DEST/${HEADER}"
|
CHEAT_FILE="$CHEAT_DEST/${HEADER}"
|
||||||
echo "(*) $CHEAT_FILE"
|
|
||||||
|
|
||||||
if [ ! -f "$CHEAT_FILE" ]; then
|
if [ ! -f "$CHEAT_FILE" ]; then
|
||||||
cp "$f" "$CHEAT_FILE"
|
cp "$f" "$CHEAT_FILE" && msg_run "$CHEAT_FILE"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
LC_ALL=C perl -pi.bak -e 's/\<\!-- CHAPTER END --\>//' "$CHEAT_FILE"
|
LC_ALL=C perl -pi.bak -e 's/\<\!-- CHAPTER END --\>//' "$CHEAT_FILE"
|
||||||
|
|||||||
@@ -17,7 +17,9 @@ TLDR_TEMP_DIR="/tmp/cheat-tldr-$(rnd)"
|
|||||||
|
|
||||||
# If there's no .git, clone the folder
|
# If there's no .git, clone the folder
|
||||||
if [ ! -d "$TLDR_TEMP_DIR/.git" ]; then
|
if [ ! -d "$TLDR_TEMP_DIR/.git" ]; then
|
||||||
git clone --depth 1 "$TLDR_GIT" "$TLDR_TEMP_DIR"
|
msg_run "Starting to clone $TLDR_GIT"
|
||||||
|
git clone --depth 1 --single-branch -q "$TLDR_GIT" "$TLDR_TEMP_DIR" \
|
||||||
|
&& msg_done "Cloned $TLDR_GIT"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Fetch the destination directory from cheat defined directories.
|
# Fetch the destination directory from cheat defined directories.
|
||||||
@@ -50,7 +52,7 @@ for d in "$TLDR_TEMP_DIR"/pages/*; do
|
|||||||
# echo "-> dest: $TLDR_FILE"
|
# echo "-> dest: $TLDR_FILE"
|
||||||
|
|
||||||
if [ ! -f "$TLDR_FILE" ]; then
|
if [ ! -f "$TLDR_FILE" ]; then
|
||||||
cp "$FILE" "$TLDR_FILE"
|
cp "$FILE" "$TLDR_FILE" && msg_run "$TLDR_FILE"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -f "$TLDR_FILE" ] && [ '---' != "$(head -1 < "$TLDR_FILE")" ]; then
|
if [ -f "$TLDR_FILE" ] && [ '---' != "$(head -1 < "$TLDR_FILE")" ]; then
|
||||||
|
|||||||
@@ -4,20 +4,21 @@
|
|||||||
# 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");')"
|
|
||||||
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
|
|
||||||
ACTUAL_CHECKSUM="$(php -r "echo hash_file('sha384', 'composer-setup.php');")"
|
|
||||||
|
|
||||||
if [ "$EXPECTED_CHECKSUM" != "$ACTUAL_CHECKSUM" ]; then
|
EXPECTED_CHECKSUM="$(php -r 'copy("https://composer.github.io/installer.sig", "php://stdout");')"
|
||||||
echo >&2 'ERROR: Invalid installer checksum'
|
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
|
||||||
rm composer-setup.php
|
ACTUAL_CHECKSUM="$(php -r "echo hash_file('sha384', 'composer-setup.php');")"
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
php composer-setup.php --quiet
|
if [ "$EXPECTED_CHECKSUM" != "$ACTUAL_CHECKSUM" ]; then
|
||||||
RESULT=$?
|
echo >&2 'ERROR: Invalid installer checksum'
|
||||||
rm composer-setup.php
|
rm composer-setup.php
|
||||||
mv composer.phar ~/.local/bin/composer
|
exit 1
|
||||||
exit $RESULT
|
fi
|
||||||
} || msg_err "PHP Not Available, cannot install composer"
|
|
||||||
|
php composer-setup.php --quiet
|
||||||
|
RESULT=$?
|
||||||
|
rm composer-setup.php
|
||||||
|
mv composer.phar ~/.local/bin/composer
|
||||||
|
exit $RESULT
|
||||||
|
|
||||||
|
|||||||
@@ -4,42 +4,42 @@
|
|||||||
# shellcheck source="shared.sh"
|
# shellcheck source="shared.sh"
|
||||||
source "$HOME/.dotfiles/scripts/shared.sh"
|
source "$HOME/.dotfiles/scripts/shared.sh"
|
||||||
|
|
||||||
have gh && {
|
|
||||||
extensions=(
|
|
||||||
# GitHub CLI extension for generating a report on repository dependencies.
|
|
||||||
andyfeller/gh-dependency-report
|
|
||||||
# GitHub CLI extension to generate montage from GitHub user avatars
|
|
||||||
andyfeller/gh-montage
|
|
||||||
# An opinionated GitHub Cli extension for creating
|
|
||||||
# changelogs that adhere to the keep a changelog specification.
|
|
||||||
chelnak/gh-changelog
|
|
||||||
# Safely deletes local branches with no upstream and no un-pushed commits
|
|
||||||
davidraviv/gh-clean-branches
|
|
||||||
# A beautiful CLI dashboard for GitHub 🚀
|
|
||||||
dlvhdr/gh-dash
|
|
||||||
# A github-cli extension script to clone all repositories
|
|
||||||
# in an organization, optionally filtering by topic.
|
|
||||||
matt-bartel/gh-clone-org
|
|
||||||
# being an extension to view the overall health of
|
|
||||||
# an organization's use of actions
|
|
||||||
rsese/gh-actions-status
|
|
||||||
)
|
|
||||||
|
|
||||||
msg "Starting to install GitHub CLI extensions..."
|
|
||||||
|
|
||||||
for ext in "${extensions[@]}"; do
|
|
||||||
# Trim spaces
|
|
||||||
ext=${ext// /}
|
|
||||||
# Skip comments
|
|
||||||
if [[ ${ext:0:1} == "#" ]]; then continue; fi
|
|
||||||
|
|
||||||
msg_run "Installing $ext"
|
|
||||||
gh extensions install "$ext"
|
|
||||||
echo ""
|
|
||||||
done
|
|
||||||
|
|
||||||
msg_ok "Done"
|
|
||||||
}
|
|
||||||
|
|
||||||
! have gh \
|
! have gh \
|
||||||
&& msg_err "gh (GitHub Client) could not be found, please install it first"
|
&& 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
|
||||||
|
# GitHub CLI extension to generate montage from GitHub user avatars
|
||||||
|
andyfeller/gh-montage
|
||||||
|
# An opinionated GitHub Cli extension for creating
|
||||||
|
# changelogs that adhere to the keep a changelog specification.
|
||||||
|
chelnak/gh-changelog
|
||||||
|
# Safely deletes local branches with no upstream and no un-pushed commits
|
||||||
|
davidraviv/gh-clean-branches
|
||||||
|
# A beautiful CLI dashboard for GitHub 🚀
|
||||||
|
dlvhdr/gh-dash
|
||||||
|
# A github-cli extension script to clone all repositories
|
||||||
|
# in an organization, optionally filtering by topic.
|
||||||
|
matt-bartel/gh-clone-org
|
||||||
|
# being an extension to view the overall health of
|
||||||
|
# an organization's use of actions
|
||||||
|
rsese/gh-actions-status
|
||||||
|
)
|
||||||
|
|
||||||
|
msg "Starting to install GitHub CLI extensions..."
|
||||||
|
|
||||||
|
for ext in "${extensions[@]}"; do
|
||||||
|
# Trim spaces
|
||||||
|
ext=${ext// /}
|
||||||
|
# Skip comments
|
||||||
|
if [[ ${ext:0:1} == "#" ]]; then continue; fi
|
||||||
|
|
||||||
|
msg_run "Installing $ext"
|
||||||
|
gh extensions install "$ext"
|
||||||
|
echo ""
|
||||||
|
done
|
||||||
|
|
||||||
|
msg_ok "Done"
|
||||||
|
|
||||||
|
|||||||
@@ -4,38 +4,37 @@
|
|||||||
# 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=(
|
|
||||||
# sysadmin/scripting utilities, distributed as a single binary
|
|
||||||
github.com/skx/sysbox@latest
|
|
||||||
# Git Profile allows you to switch between user profiles in git repos
|
|
||||||
github.com/dotzero/git-profile@latest
|
|
||||||
# An extensible command line tool or library to format yaml files.
|
|
||||||
github.com/google/yamlfmt/cmd/yamlfmt@latest
|
|
||||||
# Parsing HTML at the command line
|
|
||||||
github.com/ericchiang/pup@latest
|
|
||||||
# HTML to Markdown converter
|
|
||||||
github.com/suntong/html2md@latest
|
|
||||||
# cheat allows you to create and view interactive cheatsheets on the cli.
|
|
||||||
github.com/cheat/cheat/cmd/cheat@latest
|
|
||||||
# Render markdown on the CLI, with pizzazz! 💅
|
|
||||||
github.com/charmbracelet/glow@latest
|
|
||||||
# Static checker for GitHub Actions workflow files
|
|
||||||
github.com/rhysd/actionlint/cmd/actionlint@latest
|
|
||||||
)
|
|
||||||
|
|
||||||
for pkg in "${packages[@]}"; do
|
packages=(
|
||||||
# Trim spaces
|
# sysadmin/scripting utilities, distributed as a single binary
|
||||||
pkg=${pkg// /}
|
github.com/skx/sysbox@latest
|
||||||
# Skip comments
|
# Git Profile allows you to switch between user profiles in git repos
|
||||||
if [[ ${pkg:0:1} == "#" ]]; then continue; fi
|
github.com/dotzero/git-profile@latest
|
||||||
|
# An extensible command line tool or library to format yaml files.
|
||||||
|
github.com/google/yamlfmt/cmd/yamlfmt@latest
|
||||||
|
# Parsing HTML at the command line
|
||||||
|
github.com/ericchiang/pup@latest
|
||||||
|
# HTML to Markdown converter
|
||||||
|
github.com/suntong/html2md@latest
|
||||||
|
# cheat allows you to create and view interactive cheatsheets on the cli.
|
||||||
|
github.com/cheat/cheat/cmd/cheat@latest
|
||||||
|
# Render markdown on the CLI, with pizzazz! 💅
|
||||||
|
github.com/charmbracelet/glow@latest
|
||||||
|
# Static checker for GitHub Actions workflow files
|
||||||
|
github.com/rhysd/actionlint/cmd/actionlint@latest
|
||||||
|
)
|
||||||
|
|
||||||
msg_run "Installing go package:" "$pkg"
|
for pkg in "${packages[@]}"; do
|
||||||
go install "$pkg"
|
# Trim spaces
|
||||||
echo ""
|
pkg=${pkg// /}
|
||||||
done
|
# Skip comments
|
||||||
|
if [[ ${pkg:0:1} == "#" ]]; then continue; fi
|
||||||
|
|
||||||
msg_ok "Done"
|
msg_run "Installing go package:" "$pkg"
|
||||||
}
|
go install "$pkg"
|
||||||
|
echo ""
|
||||||
|
done
|
||||||
|
|
||||||
|
msg_ok "Done"
|
||||||
|
|
||||||
! have go && msg "go hasn't been installed yet."
|
|
||||||
|
|||||||
@@ -4,38 +4,41 @@
|
|||||||
# 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=(
|
|
||||||
# This is a tool to check if your files consider your .editorconfig rules.
|
|
||||||
"editorconfig-checker"
|
|
||||||
# Node module to create a release or a changelog from
|
|
||||||
# a tag and uses issues or commits to creating the release notes.
|
|
||||||
"github-release-notes"
|
|
||||||
"neovim"
|
|
||||||
"prettier"
|
|
||||||
"corepack"
|
|
||||||
"standardjs"
|
|
||||||
)
|
|
||||||
|
|
||||||
for pkg in "${packages[@]}"; do
|
packages=(
|
||||||
# Trim spaces
|
# This is a tool to check if your files consider your .editorconfig rules.
|
||||||
pkg=${pkg// /}
|
"editorconfig-checker"
|
||||||
# Skip comments
|
# Node module to create a release or a changelog from
|
||||||
if [[ ${pkg:0:1} == "#" ]]; then continue; fi
|
# a tag and uses issues or commits to creating the release notes.
|
||||||
|
"github-release-notes"
|
||||||
|
"neovim"
|
||||||
|
"prettier"
|
||||||
|
"corepack"
|
||||||
|
"standardjs"
|
||||||
|
# CLI and local web plain text note‑taking, bookmarking, and archiving
|
||||||
|
# with linking, tagging, filtering, search, Git versioning & syncing,
|
||||||
|
# Pandoc conversion, + more, in a single portable script.
|
||||||
|
"nb.sh"
|
||||||
|
)
|
||||||
|
|
||||||
if [[ $(npm ls -g -p "$pkg") != "" ]]; then
|
for pkg in "${packages[@]}"; do
|
||||||
msg_run_done "$pkg" "already installed"
|
# Trim spaces
|
||||||
else
|
pkg=${pkg// /}
|
||||||
msg_run "Installing npm package:" "$pkg"
|
# Skip comments
|
||||||
npm install -g --no-fund --no-progress --no-timing "$pkg"
|
if [[ ${pkg:0:1} == "#" ]]; then continue; fi
|
||||||
fi
|
|
||||||
|
|
||||||
echo ""
|
if [[ $(npm ls -g -p "$pkg") != "" ]]; then
|
||||||
done
|
msg_run_done "$pkg" "already installed"
|
||||||
|
else
|
||||||
|
msg_run "Installing npm package:" "$pkg"
|
||||||
|
npm install -g --no-fund --no-progress --no-timing "$pkg"
|
||||||
|
fi
|
||||||
|
|
||||||
msg_run "Upgrading all global packages"
|
echo ""
|
||||||
npm -g --no-progress --no-timing --no-fund outdated
|
done
|
||||||
npm -g --no-timing --no-fund upgrade
|
|
||||||
}
|
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,32 +6,31 @@
|
|||||||
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)"
|
;;
|
||||||
;;
|
Darwin)
|
||||||
Darwin)
|
NTFY_ARCH="macOS_all"
|
||||||
NTFY_ARCH="macOS_all"
|
;;
|
||||||
;;
|
esac
|
||||||
esac
|
|
||||||
|
|
||||||
NTFY_VERSION=2.2.0
|
NTFY_VERSION=2.2.0
|
||||||
NTFY_URL="https://github.com/binwiederhier/ntfy"
|
NTFY_URL="https://github.com/binwiederhier/ntfy"
|
||||||
NTFY_DEST="ntfy_${NTFY_VERSION}_${NTFY_ARCH}"
|
NTFY_DEST="ntfy_${NTFY_VERSION}_${NTFY_ARCH}"
|
||||||
|
|
||||||
curl -L "$NTFY_URL/releases/download/v${NTFY_VERSION}/${NTFY_DEST}.tar.gz" \
|
curl -L "$NTFY_URL/releases/download/v${NTFY_VERSION}/${NTFY_DEST}.tar.gz" \
|
||||||
> "${NTFY_DEST}.tar.gz"
|
> "${NTFY_DEST}.tar.gz"
|
||||||
tar zxvf "${NTFY_DEST}.tar.gz"
|
tar zxvf "${NTFY_DEST}.tar.gz"
|
||||||
cp -a "${NTFY_DEST}/ntfy" ~/.local/bin/ntfy
|
cp -a "${NTFY_DEST}/ntfy" ~/.local/bin/ntfy
|
||||||
mkdir -p ~/.config/ntfy
|
mkdir -p ~/.config/ntfy
|
||||||
|
|
||||||
# copy config only if it does not exist
|
# copy config only if it does not exist
|
||||||
if [ ! -f "$HOME/.config/ntfy/client.yml" ]; then
|
if [ ! -f "$HOME/.config/ntfy/client.yml" ]; then
|
||||||
cp "${NTFY_DEST}/client/client.yml" ~/.config/ntfy/client.yml
|
cp "${NTFY_DEST}/client/client.yml" ~/.config/ntfy/client.yml
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
rm -rf "${NTFY_DEST}" "${NTFY_DEST}.tar.gz"
|
||||||
|
|
||||||
rm -rf "${NTFY_DEST}" "${NTFY_DEST}.tar.gz"
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -4,6 +4,6 @@
|
|||||||
link:
|
link:
|
||||||
create: true
|
create: true
|
||||||
relink: true
|
relink: true
|
||||||
exclude: ["*.md", "*renovate*"]
|
exclude: [ "*.md", "*renovate*", "LICENSE" ]
|
||||||
shell:
|
shell:
|
||||||
stdout: true
|
stdout: true
|
||||||
Reference in New Issue
Block a user