Skip to content

Commit

Permalink
Fix usage
Browse files Browse the repository at this point in the history
  • Loading branch information
kachick committed Aug 22, 2023
1 parent baca0da commit b9fb31b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
13 changes: 9 additions & 4 deletions cmd/setup_windows_terminals/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,18 @@ func main() {
log.Fatalf("called with wrong arguments")
}

homePath, err := os.UserHomeDir()
if err != nil {
log.Fatalf("Failed to get home directory: %+v", err)
}

appdataPath, ok := os.LookupEnv("APPDATA")
if !ok {
log.Fatalln("ENV APPDATA is not found")
}

// As I understand it, unix like permission masks will work even in windows...
err := os.MkdirAll("~/.config/alacritty", 0750)
err = os.MkdirAll("~/.config/alacritty", 0750)
if err != nil {
log.Fatalf("Failed to create dotfiles directory: %+v", err)
}
Expand All @@ -40,9 +45,9 @@ func main() {
}

copies := []dotfiles.Copy{
{Src: filepath.Join(dotsPath, "home", ".config", "starship.toml"), Dst: "~/.config/starship.toml"},
{Src: filepath.Join(dotsPath, "home", ".config", "alacritty", "alacritty-common.yml"), Dst: "~/.config/alacritty/alacritty-common.yml"},
{Src: filepath.Join(dotsPath, "home", ".config", "alacritty", "alacritty-windows.yml"), Dst: "~/.config/alacritty/alacritty.yml"},
{Src: filepath.Join(dotsPath, "home", ".config", "starship.toml"), Dst: filepath.Join(homePath, ".config", "starship.toml")},
{Src: filepath.Join(dotsPath, "home", ".config", "alacritty", "alacritty-common.yml"), Dst: filepath.Join(homePath, ".config", "alacritty", "alacritty-common.yml")},
{Src: filepath.Join(dotsPath, "home", ".config", "alacritty", "alacritty-windows.yml"), Dst: filepath.Join(homePath, ".config", "alacritty", "alacritty.yml")},
{Src: filepath.Join(dotsPath, "windows", "config", "Profile.ps1"), Dst: pwshProfilePath},
}

Expand Down
2 changes: 1 addition & 1 deletion windows/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
```
1. New session of pwsh
```powershell
go run github.com/kachick/dotfiles/cmd/setup_windows_terminals -dotfiles_path "\\wsl.localhost\Ubuntu\home\kachick\repos\dotfiles" -pwshProfilePathFlag "$PROFILE"
go run github.com/kachick/dotfiles/cmd/setup_windows_terminals -dotfiles_path "\\wsl.localhost\Ubuntu\home\kachick\repos\dotfiles" -pwsh_profile_path "$PROFILE"
go run github.com/kachick/dotfiles/cmd/disable_windows_beeps
go run github.com/kachick/dotfiles/cmd/enable_windows_verbose_context_menu
```
Expand Down

0 comments on commit b9fb31b

Please sign in to comment.