Skip to content

Commit

Permalink
bugfix: update gnupg template
Browse files Browse the repository at this point in the history
Signed-off-by: Certseeds <51754303+Certseeds@users.noreply.github.com>
  • Loading branch information
Certseeds committed Nov 18, 2023
1 parent e4ebea6 commit 7aa377d
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 3 deletions.
3 changes: 2 additions & 1 deletion git/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.gitconfig
.ssh/config
.ssh/config
gpg.sshcontrol.conf
1 change: 1 addition & 0 deletions git/gpg.sshcontrol.conf.template
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# keygrip
5 changes: 4 additions & 1 deletion git/linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ cd git
NOW_TIME=$(date --iso-8601=seconds)

mkdir -p "${HOME}"/.ssh
mkdir -p "${HOME}"/.gnupg

files=("${HOME}/.gitconfig" "${HOME}/.ssh/config")
files=("${HOME}/.gitconfig" "${HOME}/.ssh/config" "${HOME}/.gnupg/gpg.sshcontrol.conf")
for item in "${files[@]}"; do
echo "${item}"
if [[ -e "${item}" ]]; then
Expand All @@ -23,10 +24,12 @@ unset files

sudo ln -s "$(pwd)"/.gitconfig "${HOME}"/.gitconfig
sudo ln -s "$(pwd)"/.ssh/config "${HOME}"/.ssh/config
sudo ln -s "$(pwd)"/gpg.sshcontrol.conf "${HOME}"/.gnupg/gpg.sshcontrol.conf

sudo chown -R "${USER}":"${USER}" "${HOME}"/.gitconfig
sudo chown -R "${USER}":"${USER}" "${HOME}"/.ssh
sudo chown -R "${USER}":"${USER}" "${HOME}"/.ssh/config
sudo chown -R "${USER}":"${USER}" "${HOME}"/.gnupg/gpg.sshcontrol.conf

sudo chmod 0755 "${HOME}"/.ssh

Expand Down
10 changes: 9 additions & 1 deletion git/windows.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ $script = {
}
function backup_exists_file() {
mkdir "${userPath}\dotfilesbackup\${time}"
$Array = ("$userPath\.gitconfig", "$userPath\.ssh\config")
$Array = ("$userPath\.gitconfig", "$userPath\.ssh\config", "$userPath\.gnupg\gpg.sshcontrol.conf")
foreach ($file in $Array) {
Write-Output ${file}
$T_F = (Test-Path -Path ${file} -PathType Leaf)
Expand All @@ -35,6 +35,7 @@ $script = {
function conf() {
conf-git
conf-ssh
conf-gpg
}
function conf-git() {
New-Item -Path "$userPath\.gitconfig" `
Expand All @@ -56,6 +57,13 @@ $script = {
# `~/.gitconfig`
# `git config --list`
}
function conf-gpg() {
$folder = "$userPath\.gnupg"
New-Item -Path "$folder\gpg.sshcontrol.conf" `
-ItemType SymbolicLink `
-Value "$userPath\dotfiles\git\gpg.sshcontrol.conf"
# test by `pip config list -v`
}
function main {
ensure_dir
backup_exists_file
Expand Down
3 changes: 3 additions & 0 deletions lang/windows.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ $script = {
New-Item -Path "$folder\gpg.conf" `
-ItemType SymbolicLink `
-Value "$userPath\dotfiles\lang\gpg.conf"
New-Item -Path "$folder\gpg.agent.conf" `
-ItemType SymbolicLink `
-Value "$userPath\dotfiles\lang\gpg.agent.conf"
# test by `pip config list -v`
}
function conf-pip() {
Expand Down

0 comments on commit 7aa377d

Please sign in to comment.