Trying branches per OS

This commit is contained in:
TheFlyingFool 2024-06-10 17:58:05 -05:00
parent 65e386acac
commit a5491ea108
4 changed files with 0 additions and 83 deletions

View File

@ -1,52 +0,0 @@
# dotfiles
My dotfiles for both Arch Linux and Windows
## Useage on Linux
### Checking out the repo
```sh
git clone --bare gitea@git.theflyingfool.com:theflyingfool/dotfiles.git $HOME/.dot
alias dot='/usr/bin/git --git-dir="$HOME/.dot/" --work-tree="$HOME"'
dot checkout
dot config --local status.showUntrackedFiles no
source ~/.zshrc
```
If there are conflicts:
```sh
mkdir -p .dot-backup && \
dot checkout 2>&1 | egrep "\s+\." | awk {'print $1'} | \
xargs -I{} mv {} .dot-backup/{}
dot checkout
```
### Managing dotfiles
**Adding or Modifying files**
```sh
dot add .zshrc
dot commit -m "Update .zshrc"
dot push
```
## Useage on Windows
### Checking out the repo
```ps1
PowerShell -NoProfile -ExecutionPolicy Bypass
git clone --bare https://git.theflyingfool.com/theflyingfool/dotfiles.git $HOME/.dot
if (!(Test-Path -Path $PROFILE)) {
# Create the profile
New-Item -Type File -Path $PROFILE -Force
}
"`nfunction dot { & git --git-dir=`"$HOME/.dot/`" --work-tree=`"$HOME`" @args }" | Out-File -Append $PROFILE
. $PROFILE
dot checkout
dot config --local status.showUntrackedFiles no
"`n. `"$HOME/windows/Microsoft.PowerShell_profile.ps1`"" | Out-File -Append $PROFILE
```

View File

@ -1,15 +0,0 @@
Register-ArgumentCompleter -Native -CommandName winget -ScriptBlock {
param($wordToComplete, $commandAst, $cursorPosition)
[Console]::InputEncoding = [Console]::OutputEncoding = $OutputEncoding = [System.Text.Utf8Encoding]::new()
$Local:word = $wordToComplete.Replace('"', '""')
$Local:ast = $commandAst.ToString().Replace('"', '""')
winget complete --word="$Local:word" --commandline "$Local:ast" --position $cursorPosition | ForEach-Object {
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterValue', $_)
}
}
function dot { & git --git-dir="$HOME/.dot/" --work-tree="$HOME" @args }
# Source the aliases.ps1 file
. "$PSScriptRoot/aliases.ps1"

View File

@ -1,9 +0,0 @@
Register-ArgumentCompleter -Native -CommandName winget -ScriptBlock {
param($wordToComplete, $commandAst, $cursorPosition)
[Console]::InputEncoding = [Console]::OutputEncoding = $OutputEncoding = [System.Text.Utf8Encoding]::new()
$Local:word = $wordToComplete.Replace('"', '""')
$Local:ast = $commandAst.ToString().Replace('"', '""')
winget complete --word="$Local:word" --commandline "$Local:ast" --position $cursorPosition | ForEach-Object {
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterValue', $_)
}
}

View File

@ -1,7 +0,0 @@
function Upgrade-All { winget upgrade --all }
Set-Alias -Name Syu -Value Upgrade-All
function touch($file) {
"" | Out-File $file -Encoding ASCII
}