Merge branch 'master' of gitee.com:klesh/dotfiles

This commit is contained in:
Klesh Wong 2021-06-12 11:00:12 +08:00
commit 07bf27188d
2 changed files with 13 additions and 5 deletions

View File

@ -32,6 +32,10 @@ function EnsurePath {
[String] $PassPath [String] $PassPath
) )
if (!$PassPath) {
throw "path is empty!"
}
$PassPath = Join-Path $PASSWORD_STORE_DIR $PassPath $PassPath = Join-Path $PASSWORD_STORE_DIR $PassPath
if (!$PassPath.EndsWith(".gpg")) { if (!$PassPath.EndsWith(".gpg")) {
$PassPath = $PassPath + ".gpg" $PassPath = $PassPath + ".gpg"
@ -60,7 +64,7 @@ function FzfPass {
$PASSWORD_STORE_DIR.Length+1, $PASSWORD_STORE_DIR.Length+1,
$_.FullName.Length-$PASSWORD_STORE_DIR.Length-5 $_.FullName.Length-$PASSWORD_STORE_DIR.Length-5
) )
} | Invoke-Fzf } | fzf
} }
function Edit-Pass { function Edit-Pass {
@ -71,6 +75,9 @@ function Edit-Pass {
if (!$PassPath) { if (!$PassPath) {
$PassPath = FzfPass $PassPath = FzfPass
if (!$?) {
return
}
} }
$PassPath = EnsurePath $PassPath $PassPath = EnsurePath $PassPath

View File

@ -1,7 +1,8 @@
# curl: https://curl.se/windows/ # curl: https://curl.se/windows/
# ag: https://github.com/k-takata/the_silver_searcher-win32/releases # ag: https://github.com/k-takata/the_silver_searcher-win32/releases
# fzf: https://github.com/junegunn/fzf/releases/latest (2.7.2 not working with psfzf) # fzf: https://github.com/junegunn/fzf/releases/latest (2.7.2 not working with psfzf)
$PSDefaultParameterValues = @{ "*:Proxy"="http://localhost:8123" } # utf-8 for i18n: Settings and then: All Settings -> Time & Language -> Language -> "Administrative Language Settings"
$PSDefaultParameterValues = @{ "*:Proxy"="http://localhost:2021" }
#Install-Module -Name PowerShellGet -Force -AllowPrerelease #Install-Module -Name PowerShellGet -Force -AllowPrerelease
Register-PSRepository -Default -InstallationPolicy Trusted Register-PSRepository -Default -InstallationPolicy Trusted
Set-PSRepository -Name 'PSGallery' -InstallationPolicy Trusted Set-PSRepository -Name 'PSGallery' -InstallationPolicy Trusted