mirror of
https://github.com/Crocmagnon/dotfiles.git
synced 2024-11-23 06:58:04 +01:00
Compare commits
No commits in common. "e5bf69149d0b68a804ce3705217415f53263c4bc" and "aed1729be5534836168ac5f4ef0fb67d0be10fbe" have entirely different histories.
e5bf69149d
...
aed1729be5
6 changed files with 51 additions and 40 deletions
|
@ -1,10 +1,3 @@
|
||||||
function bwunlock
|
function bwunlock
|
||||||
set -x NODE_OPTIONS "--no-deprecation"
|
set -g BW_SESSION (bw login --raw)
|
||||||
|
|
||||||
if not bw login --check
|
|
||||||
set -gx BW_SESSION (bw login --raw)
|
|
||||||
end
|
|
||||||
if not bw unlock --check
|
|
||||||
set -gx BW_SESSION (bw unlock --raw)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,5 +1,11 @@
|
||||||
function chezmoiapply
|
function chezmoiapply
|
||||||
set -x NODE_OPTIONS "--no-deprecation"
|
set -x NODE_OPTIONS "--no-deprecation"
|
||||||
bwunlock
|
|
||||||
chezmoi apply
|
if not bw login --check
|
||||||
|
set -x BW_SESSION (bw login --raw)
|
||||||
|
end
|
||||||
|
if not bw unlock --check
|
||||||
|
set -x BW_SESSION (bw unlock --raw)
|
||||||
|
end
|
||||||
|
chezmoi apply
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,5 +1,10 @@
|
||||||
function chezmoiupdate
|
function chezmoiupdate
|
||||||
set -x NODE_OPTIONS "--no-deprecation"
|
set -x NODE_OPTIONS "--no-deprecation"
|
||||||
bwunlock
|
if not bw login --check
|
||||||
chezmoi update
|
set -x BW_SESSION (bw login --raw)
|
||||||
|
end
|
||||||
|
if not bw unlock --check
|
||||||
|
set -x BW_SESSION (bw unlock --raw)
|
||||||
|
end
|
||||||
|
chezmoi update
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,19 +1,23 @@
|
||||||
function fetchkeys
|
function fetchkeys
|
||||||
set -x NODE_OPTIONS "--no-deprecation"
|
if not bw login --check
|
||||||
bwunlock
|
set -x BW_SESSION (bw login --raw)
|
||||||
set key_item (bw list items --search "SSH Main" | jq ".[0]" --raw-output)
|
end
|
||||||
set key_item_id (echo $key_item | jq ".id" --raw-output)
|
if not bw unlock --check
|
||||||
set key1 (echo $key_item | jq ".attachments[0]" --raw-output)
|
set -x BW_SESSION (bw unlock --raw)
|
||||||
set key1_name (echo $key1 | jq ".fileName" --raw-output)
|
end
|
||||||
set key1_id (echo $key1 | jq ".id" --raw-output)
|
set key_item (bw list items --search "SSH Main" | jq ".[0]" --raw-output)
|
||||||
set key2 (echo $key_item | jq ".attachments[1]" --raw-output)
|
set key_item_id (echo $key_item | jq ".id" --raw-output)
|
||||||
set key2_name (echo $key2 | jq ".fileName" --raw-output)
|
set key1 (echo $key_item | jq ".attachments[0]" --raw-output)
|
||||||
set key2_id (echo $key2 | jq ".id" --raw-output)
|
set key1_name (echo $key1 | jq ".fileName" --raw-output)
|
||||||
bw get attachment $key1_id --output "./$key1_name" --itemid $key_item_id
|
set key1_id (echo $key1 | jq ".id" --raw-output)
|
||||||
bw get attachment $key2_id --output "./$key2_name" --itemid $key_item_id
|
set key2 (echo $key_item | jq ".attachments[1]" --raw-output)
|
||||||
if string match -q -- '*.pub' $key1_name
|
set key2_name (echo $key2 | jq ".fileName" --raw-output)
|
||||||
chmod 600 $key2_name
|
set key2_id (echo $key2 | jq ".id" --raw-output)
|
||||||
else
|
bw get attachment $key1_id --output "./$key1_name" --itemid $key_item_id
|
||||||
chmod 600 $key1_name
|
bw get attachment $key2_id --output "./$key2_name" --itemid $key_item_id
|
||||||
end
|
if string match -q -- '*.pub' $key1_name
|
||||||
|
chmod 600 $key2_name
|
||||||
|
else
|
||||||
|
chmod 600 $key1_name
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,8 +1,13 @@
|
||||||
function upgrade --wraps=topgrade
|
function upgrade --wraps=topgrade
|
||||||
set -x NODE_OPTIONS "--no-deprecation"
|
set -x NODE_OPTIONS "--no-deprecation"
|
||||||
bwunlock
|
if not bw login --check
|
||||||
{{- if get . "sudo" }}
|
set -x BW_SESSION (bw login --raw)
|
||||||
sudo ls >/dev/null
|
end
|
||||||
{{- end }}
|
if not bw unlock --check
|
||||||
topgrade $argv
|
set -x BW_SESSION (bw unlock --raw)
|
||||||
|
end
|
||||||
|
{{- if get . "sudo" }}
|
||||||
|
sudo ls >/dev/null
|
||||||
|
{{- end }}
|
||||||
|
topgrade $argv
|
||||||
end
|
end
|
||||||
|
|
|
@ -8,13 +8,11 @@
|
||||||
disable = [
|
disable = [
|
||||||
"mas",
|
"mas",
|
||||||
"pip3",
|
"pip3",
|
||||||
"gem",
|
|
||||||
"ruby_gems",
|
|
||||||
{{- if eq .chezmoi.os "darwin" }}
|
{{- if eq .chezmoi.os "darwin" }}
|
||||||
"vim",
|
"vim",
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- if not (get . "sudo") }}
|
{{- if not (get . "sudo") }}
|
||||||
"node",
|
"npm",
|
||||||
{{- end }}
|
{{- end }}
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue