diff options
| author | 2025-02-14 10:16:52 +0000 | |
|---|---|---|
| committer | 2025-02-14 10:16:52 +0000 | |
| commit | 6efca1addcddec3edd45f03f774586711cb3b54c (patch) | |
| tree | f06171ea2dd4aa29eb6f79a0b19c784c100d1d95 | |
| parent | 3e8ac2f7bc363cbd697d5aa342103962da91299b (diff) | |
update clone-dotfiles.sh
| -rwxr-xr-x | clone-dotfiles.sh (renamed from cloneDotfiles.sh) | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/cloneDotfiles.sh b/clone-dotfiles.sh index fcccb33..cbc43f3 100755 --- a/cloneDotfiles.sh +++ b/clone-dotfiles.sh @@ -1,14 +1,17 @@ -#!/bin/bash +#!/usr/bin/env bash +declare -g httpsToken + +export function setStatusE() { - if [[ "$1" = true ]]; then - set +e - else + if [[ "$1" = "on" ]]; then set -e + else + set +e fi } -setStatusE false +setStatusE "on" function getKdbxFile() { read -r passwordFileLink < <("$HOME/.local/bin/yadisk-direct" https://yadi.sk/d/o4TMFnHFobxTsw) @@ -17,9 +20,10 @@ function getKdbxFile() { } function openKeepass() { - setStatusE true + setStatusE "off" - keepassxc-cli clip ~/Passwords.kdbx Github 0 -a token-cli + httpsToken=$(keepassxc-cli show --attribute https-token "$HOME/Passwords.kdbx" soft-serve 0) + return 0 } pipx install wldhx.yadisk-direct @@ -32,15 +36,11 @@ fi getKdbxFile while :; do - openKeepass - - if [[ $? -eq 0 ]]; then - setStatusE false - echo -e "Пароль скопирован!\n" + if [[ $(openKeepass) -eq 0 ]]; then + setStatusE "on" break fi done cd -git clone https://blueingreen68@github.com/blueingreen68/dotfiles "$HOME"/.dotfiles -wl-copy -c +git clone https://"$httpsToken"@ss.bluig.xyz/.init.git "$HOME/init" |
