Skip to content

kumarstack55/dotfiles

Repository files navigation

CI

dotfiles

対応OS

  • ArchLinux
  • Debian
  • EL7
  • Windows
  • Windows + WSL
  • Windows + cygwin
  • macOS

要件

  • git

インストール

macOS, EL7, Debian, Ubuntu, Windows+mintty

cd /tmp
curl -LO https://raw.githubusercontent.com/kumarstack55/dotfiles/master/bootstrap.sh
chmod -v +x bootstrap.sh
./bootstrap.sh

または

cd $HOME
git clone git@github.com:kumarstack55/dotfiles.git

cd $HOME
dotfiles/bin/installer.sh

Windows+PowerShell

シンボリックリンクを扱うため PowerShell を管理者権限で実行する。

cd $HOME
git clone git@github.com:kumarstack55/dotfiles.git

cd $HOME/dotfiles/bin
./installer.ps1

変更する場合

commitizen

cd $HOME/dotfiles
npm install commitizen
npm install cz-conventional-changelog
exec $SHELL -l
npm run commit

playbook.json を再生成する。

  • Ubuntu ディストリビューションを作り直し、 wsl に入る。
$distribution = "Ubuntu"
wsl --list --verbose
wsl --terminate $distribution
wsl --unregister $distribution
wsl --list --online
wsl --install $distribution
wsl --set-default $distribution
wsl --list --verbose

wsl
sudo apt update
sudo apt list --upgradable
sudo apt upgrade
  • SSH秘密鍵、公開鍵のペアを生成する。
cd $HOME

get_kernel_release() {
  uname -r
}

test_wsl() {
  local kernel_release=$(get_kernel_release)
  [[ $kernel_release =~ WSL2$ ]]
}

get_ssh_keygen_comment() {
  echo "${USER}@$(uname -n)-$(test_wsl && echo "wsl-")generated-at-$(date "+%F")"
}

ssh_keygen_comment=$(get_ssh_keygen_comment)
output_keyfile=~/.ssh/id_rsa
id_rsa_pub_path="${output_keyfile}.pub"

test ! -e "${output_keyfile}" \
  && ssh-keygen -f "${output_keyfile}" -N '' -C "${ssh_keygen_comment}"

# 生成した公開鍵を得る。
cat "${id_rsa_pub_path}"
curl -sSL https://install.python-poetry.org | POETRY_VERSION=1.7.1 python3 -
exit
wsl
  • ビルドする。
sudo apt install make

cd $HOME/dotfiles
poetry install --no-root
poetry run make

#git config user.email "kumarstack55@gmail.com"
#git config user.name "kumarstack55"
  • git commit, git push する。
    • (省略)

参考

Windows で OneDrive にドキュメントなどを同期しない場合

PS > $PROFILE -replace $env:USERNAME, 'your_user_name'
C:\Users\your_user_name\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1