diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 2b9f883..6fddca0 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,6 +1,5 @@ version: 2 updates: - # Maintain dependencies for GitHub Actions - package-ecosystem: "github-actions" directory: "/" diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml index d503821..ff6b5bb 100644 --- a/.github/workflows/changelog.yml +++ b/.github/workflows/changelog.yml @@ -1,22 +1,17 @@ ---- name: Debug Changelog # Workflow name displayed on GitHub - on: workflow_dispatch: # Trigger manually - jobs: debug-changelog: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - name: Create changelog text id: changelog uses: loopwerk/tag-changelog@v1 with: token: ${{ secrets.GITHUB_TOKEN }} config_file: .github/tag-changelog-config.js - - name: "Echo results" id: output-changelog run: | diff --git a/.github/workflows/new-release.yml b/.github/workflows/new-release.yml index 4ec7fa0..fc8fd08 100644 --- a/.github/workflows/new-release.yml +++ b/.github/workflows/new-release.yml @@ -1,14 +1,10 @@ ---- name: Release Daily State # Workflow name displayed on GitHub - on: workflow_dispatch: # Trigger manually schedule: - cron: "30 20 * * *" # UTC is 2-3 hours behind Europe/Helsinki, my timezone - permissions: contents: write - jobs: new-daily-release: runs-on: ubuntu-latest @@ -17,11 +13,9 @@ jobs: version: ${{ steps.daily-version.outputs.version }} steps: - uses: actions/checkout@v3 # Checkout our working repository - - name: Create tag if necessary uses: fregante/daily-version-action@v2 id: daily-version - - name: Create changelog text if: steps.daily-version.outputs.created id: changelog @@ -29,7 +23,6 @@ jobs: with: token: ${{ secrets.GITHUB_TOKEN }} config_file: .github/tag-changelog-config.js - - name: Create release if: steps.daily-version.outputs.created uses: actions/create-release@latest diff --git a/.github/workflows/update-submodules.yml b/.github/workflows/update-submodules.yml index bc3f145..8032b5d 100644 --- a/.github/workflows/update-submodules.yml +++ b/.github/workflows/update-submodules.yml @@ -1,13 +1,11 @@ name: Update submodules on: - schedule: [cron: 0 3 * * *] + schedule: [{cron: 0 3 * * *}] workflow_dispatch: - permissions: contents: write issues: write pull-requests: write - jobs: update-submodules: runs-on: ubuntu-latest @@ -18,12 +16,10 @@ jobs: submodules: true fetch-depth: 0 token: ${{secrets.GITHUB_TOKEN}} - - name: Config Git User run: | git config --global user.name "${{ github.actor }}" git config --global user.email "${{ github.actor }}@users.noreply.github.com" - - name: Update submodules run: | if git commit -am"chore(git): Update submodules (automated) diff --git a/config/alias b/config/alias index 2ccc9f1..8554d1a 100755 --- a/config/alias +++ b/config/alias @@ -1,5 +1,6 @@ #!/usr/bin/env bash # shellcheck source="../scripts/shared.sh" +# shellcheck disable=1091,2139 source "$DOTFILES/scripts/shared.sh" # Get installed php versions from brew and setup aliases diff --git a/config/cheat/conf.yml b/config/cheat/conf.yml index b47de8e..1e72e52 100644 --- a/config/cheat/conf.yml +++ b/config/cheat/conf.yml @@ -1,24 +1,19 @@ ---- # The editor to use with 'cheat -e '. Defaults to $EDITOR or $VISUAL. # editor: $EDITOR # Should 'cheat' always colorize output? colorize: true - # Which 'chroma' colorscheme should be applied to the output? # Options are available here: # https://github.com/alecthomas/chroma/tree/master/styles style: "catppuccin" - # Which 'chroma' "formatter" should be applied? # One of: "terminal", "terminal256", "terminal16m" formatter: terminal256 - # Through which pager should output be piped? # 'less -FRX' is recommended on Unix systems # 'more' is recommended on Windows pager: less -FRX - # Cheatpaths are paths at which cheatsheets are available on your local # filesystem. # @@ -63,21 +58,21 @@ cheatpaths: # 'readonly': shall user-created ('cheat -e') cheatsheets be saved here? - name: community path: ~/.config/cheat/cheatsheets/community - tags: [ community ] + tags: [community] readonly: true # If you have personalized cheatsheets, list them last. They will take # precedence over the more global cheatsheets. - name: personal path: ~/.dotfiles/config/cheat/cheatsheets/personal - tags: [ personal ] + tags: [personal] readonly: false - name: pure-bash-bible path: ~/.dotfiles/config/cheat/cheatsheets/pure-bash-bible - tags: [ pure-bash-bible ] + tags: [pure-bash-bible] readonly: true - name: tldr path: ~/.dotfiles/config/cheat/cheatsheets/tldr - tags: [ tldr ] + tags: [tldr] readonly: true # While it requires no configuration here, it's also worth noting that diff --git a/config/exports-apps b/config/exports-apps index 338edae..ea7632b 100755 --- a/config/exports-apps +++ b/config/exports-apps @@ -1,7 +1,7 @@ #!/usr/bin/env bash # shellcheck shell=bash # shellcheck enable=external-sources -# shellcheck disable=1091 +# shellcheck disable=1091,2139 # vim: filetype=zsh source "$DOTFILES/scripts/shared.sh" diff --git a/local/bin/pushover b/local/bin/pushover index 122aea8..f71e2e6 100755 --- a/local/bin/pushover +++ b/local/bin/pushover @@ -5,7 +5,8 @@ # # Modified by Ismo Vuorinen 2023 -__pushover_usage() { +__pushover_usage() +{ printf "pushover \n" printf " -c \n" printf " -d \n" @@ -22,7 +23,8 @@ __pushover_usage() { return 1 } -__pushover_opt_field() { +__pushover_opt_field() +{ field=$1 shift value="${*}" @@ -31,7 +33,8 @@ __pushover_opt_field() { fi } -__pushover_send_message() { +__pushover_send_message() +{ device="${1:-}" curl_cmd="\"${CURL}\" -s -S \ @@ -71,8 +74,7 @@ devices="${devices} ${device}" optstring="c:d:D:e:f:p:r:t:T:s:u:U:a:h" OPTIND=1 -while getopts ${optstring} c -do +while getopts ${optstring} c; do case ${c} in c) callback="${OPTARG}" @@ -117,7 +119,7 @@ do ;; esac done -shift $((OPTIND-1)) +shift $((OPTIND - 1)) if [ "$#" -lt 1 ]; then __pushover_usage @@ -141,9 +143,8 @@ else __pushover_send_message "${device}" r=${?} if [ "${r}" -ne 0 ]; then - break; + break fi done fi exit "${r}" - diff --git a/local/bin/x-sha256sum-matcher b/local/bin/x-sha256sum-matcher index bd049f5..bd20bb6 100755 --- a/local/bin/x-sha256sum-matcher +++ b/local/bin/x-sha256sum-matcher @@ -14,7 +14,8 @@ file_2="$2" # return sha256sum for file # $1 - filename (string) -get_sha256sum() { +get_sha256sum() +{ sha256sum "$1" | head -c 64 } @@ -22,11 +23,13 @@ get_sha256sum() { echo "Usage: $0 file1.sh file2.sh" && exit 1 } -msg() { +msg() +{ [[ "$VERBOSE" -eq 1 ]] && echo "$1" } -error() { +error() +{ msg "(!) ERROR: $1" && exit 1 } @@ -45,6 +48,5 @@ if [ "$file_1_hash" != "$file_2_hash" ]; then error "Files do not match" else msg "(*) Success: Files do match" - exit 0; + exit 0 fi - diff --git a/scripts/shared.sh b/scripts/shared.sh index 4696cc8..3e14e36 100755 --- a/scripts/shared.sh +++ b/scripts/shared.sh @@ -6,7 +6,6 @@ # Helper env variables. Use like this: VERBOSE=1 ./script.sh : "${VERBOSE:=0}" - # -- Colors -- # CLR_RED="\033[1;31m" CLR_YELLOW="\033[1;33m" @@ -254,11 +253,11 @@ function replacable() [[ ! -r "$FILE1" ]] && { [[ $VERBOSE -eq 1 ]] && msg_err "File 1 ($FILE1) does not exist" - return 0; + return 0 } [[ ! -r "$FILE2" ]] && { [[ $VERBOSE -eq 1 ]] && msg_err "File 2 ($FILE2) does not exist, replacable" - return 1; + return 1 } FILE1_HASH=$(get_sha256sum "$FILE1") @@ -266,20 +265,19 @@ function replacable() [[ $FILE1_HASH = "" ]] && { [[ $VERBOSE -eq 1 ]] && msg_err "Could not get hash for file 1 ($FILE1)" - return 0; + return 0 } [[ $FILE2_HASH = "" ]] && { [[ $VERBOSE -eq 1 ]] && msg_err "Could not get hash for file 2 ($FILE2), replacable" - return 1; + return 1 } [[ "$FILE1_HASH" == "$FILE2_HASH" ]] && { [[ $VERBOSE -eq 1 ]] && msg_ok "Files match, not replacable: $FILE1" - return 0; + return 0 } [[ $VERBOSE -eq 1 ]] && msg_warn "Files do not match ($FILE1_HASH != $FILE2_HASH), replacable" - return 1; + return 1 } - diff --git a/tools/dotbot-defaults.yaml b/tools/dotbot-defaults.yaml index 20e0b6e..7db8806 100644 --- a/tools/dotbot-defaults.yaml +++ b/tools/dotbot-defaults.yaml @@ -4,6 +4,6 @@ link: create: true relink: true - exclude: [ "*.md", "*renovate*", "LICENSE" ] + exclude: ["*.md", "*renovate*", "LICENSE"] shell: stdout: true