Skip to content

Commit

Permalink
cleanup config and install
Browse files Browse the repository at this point in the history
  • Loading branch information
myty committed Sep 19, 2023
1 parent 17d0f5b commit 83d8eed
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 871 deletions.
18 changes: 5 additions & 13 deletions install.nu
Original file line number Diff line number Diff line change
@@ -1,16 +1,8 @@
let local_config_dir = $"($env.USERPROFILE)\\.config\\nushell"
let dotfiles_symlink = $"($env.USERPROFILE)\\.config\\dotfiles"
let local_config_path = $"($local_config_dir)\\local-config.nu"
let dotfiles_symlink_path = $"($env.USERPROFILE)\\.config\\dotfiles"

# Copy sample-config/local-config.nu if ~/.config/nushell/local-config.nu does not exist
if (($local_config_path | path exists) != true) {
mkdir $"($local_config_dir)"
cp $"($env.PWD)\\nushell\\sample-config\\local-config.nu" $"($local_config_path)"
if (($dotfiles_symlink_path | path exists) != true) {
if ((sys).host.name == "Windows") { ^mklink /d $"($dotfiles_symlink_path)" $"($env.PWD)" } else { ^ln -s $env.PWD $dotfiles_symlink_path }
}

if (($dotfiles_symlink | path exists) != true) {
if ((sys).host.name == "Windows") { ^mklink /d $"($dotfiles_symlink)" $"($env.PWD)" } else { ^ln -s $env.PWD $dotfiles_symlink }
}

echo $"source ($env.PWD)\\nushell\\config.nu" | save $"($nu.config-path)"
echo $"source ($env.PWD)\\nushell\\env.nu" | save $"($nu.env-path)"
echo $"\n\n# Load config.nu\nsource ~\\.config\\dotfiles\\nushell\\config.nu" | save --raw --append $"($nu.config-path)"
echo $"\n\n# Load env.nu\nsource ~\\.config\\dotfiles\\nushell\\env.nu" | save --raw --append $"($nu.env-path)"
Loading

0 comments on commit 83d8eed

Please sign in to comment.