Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Not creating directory symbolic #176

Open
niamotullah opened this issue Jul 8, 2024 · 4 comments
Open

[BUG] Not creating directory symbolic #176

niamotullah opened this issue Jul 8, 2024 · 4 comments

Comments

@niamotullah
Copy link

niamotullah commented Jul 8, 2024

Environment

  • OS: Linux distribution
  • Dotter version: dotter 0.13.2
  • Additional relevant information

Description

nvim = "~/.config/nvim" in config instead of creating a directory symlink it creates folder nvim and symlinks every individual files of nvim/ directory. now if i create any new files or incase application creates any new config on their respective config directory, it won't store that new config on the .dotfiles/nvim directory.

Reproduction

global.toml

[helpers]

[default]
depends = []

[default.files]
dotter = ""
# nvim = "~/.config/nvim"
"zsh/zshrc" = "~/.zshrc"
"zsh/zsh_history" = "~/.zsh_history"
"zsh/oh-my-zsh" = "~/.oh-my-zsh"
test_dir = "~/.test_dir"


[default.variables]

[settings]
default_target_type = "symbolic"

local.toml

includes = []
packages = ["default"]

[files]

[variables]

file structure:

➜  ~ tree -L 2 .dotfiles               
.dotfiles
├── dotter
├── nvim
│   ├── init.lua
│   ├── lazy-lock.json
│   ├── lazyvim.json
│   ├── LICENSE
│   ├── lua
│   ├── README.md
│   └── stylua.toml
└── zsh
    ├── oh-my-zsh
    ├── zsh_history
    └── zshrc

5 directories, 9 files]

Actual behavior

➜  .dotfiles git:(master) ✗ ./dotter deploy
➜  .dotfiles git:(master) ✗ cd ~
➜  ~ file .oh-my-zsh 
.oh-my-zsh: directory

➜  ~ file .oh-my-zsh/plugins 
.oh-my-zsh/plugins: directory

➜  ~ file .oh-my-zsh/oh-my-zsh.sh 
.oh-my-zsh/oh-my-zsh.sh: symbolic link to /home/niamotullah/.dotfiles/zsh/oh-my-zsh/oh-my-zsh.sh

➜  ~ echo "something" > .oh-my-zsh/test 
➜  ~ file .oh-my-zsh/test              
.oh-my-zsh/test: ASCII text

➜  ~ file .dotfiles/zsh/oh-my-zsh/test
.dotfiles/zsh/oh-my-zsh/test: cannot open `.dotfiles/zsh/oh-my-zsh/test' (No such file or directory)



Expected behavior

➜  ~ rm -rf .oh-my-zsh 
➜  ~ ln -s .dotfiles/zsh/oh-my-zsh .oh-my-zsh 
➜  ~ file .oh-my-zsh 
.oh-my-zsh: symbolic link to .dotfiles/zsh/oh-my-zsh

➜  ~ file .oh-my-zsh/oh-my-zsh.sh 
.oh-my-zsh/oh-my-zsh.sh: ASCII text

➜  ~ file .oh-my-zsh/plugins     
.oh-my-zsh/plugins: directory

➜  ~ echo "something" > .oh-my-zsh/test
➜  ~ file .oh-my-zsh/test 
.oh-my-zsh/test: ASCII text

➜  ~ file .dotfiles/zsh/oh-my-zsh/test 
.dotfiles/zsh/oh-my-zsh/test: ASCII text
``

@niamotullah niamotullah changed the title [BUG] [BUG] Not creating directory symbolic Jul 9, 2024
@SuperCuber
Copy link
Owner

This is expected behavior, and there is an option to disable it.
It was added and never documented 🙃 whoops!

Either specify recurse = false before your [helpers] section to disable this behavior globally, or specify

nvim = {type = "symbolic", target = "~/.config/nvim", recurse = false}

to disable for a specific folder.

Leaving this open for now as a reminder to self:

  • Add documentation to the wiki about global and per-file option
  • Perhaps move recurse into settings section

@niamotullah
Copy link
Author

niamotullah commented Jul 11, 2024

This is expected behavior, and there is an option to disable it. It was added and never documented 🙃 whoops!

Either specify recurse = false before your [helpers] section to disable this behavior globally, or specify

nvim = {type = "symbolic", target = "~/.config/nvim", recurse = false}

to disable for a specific folder.

Leaving this open for now as a reminder to self:

* [ ]  Add documentation to the wiki about global and per-file option

* [ ]  Perhaps move `recurse` into `settings` section

Error:

$ ./dotter -vvv
[TRACE] [src/main.rs:79] Loaded options: Options {
    global_config: ".dotter/global.toml",
    local_config: ".dotter/local.toml",
    cache_file: ".dotter/cache.toml",
    cache_directory: ".dotter/cache",
    pre_deploy: ".dotter/pre_deploy.sh",
    post_deploy: ".dotter/post_deploy.sh",
    pre_undeploy: ".dotter/pre_undeploy.sh",
    post_undeploy: ".dotter/post_undeploy.sh",
    dry_run: false,
    verbosity: 3,
    quiet: false,
    force: false,
    noconfirm: false,
    patch: false,
    diff_context_lines: 3,
    action: None,
}
[DEBUG] [src/main.rs:95] Deploying...
[TRACE] [src/deploy.rs:28] Manual patch: None
[ERROR] Failed to deploy
Caused by:
    get a configuration
    load global config ".dotter/global.toml"
    deserialize file contents
    invalid type: boolean `false`, expected struct Package


global.toml:

recurse = false

[helpers]

[default]
depends = []

[default.files]
"README.md" = ""
dotter = ""
nvim = "~/.config/nvim"

[default.variables]

[settings]
default_target_type = "symbolic"

@SuperCuber
Copy link
Owner

You're right. I've started work on moving it to the part of the code that reads from global.toml

#177

Encountered a weird problem when moving between recursive and non recursive dir, ill work on it later

@niamotullah
Copy link
Author

You're right. I've started work on moving it to the part of the code that reads from global.toml

#177

Encountered a weird problem when moving between recursive and non recursive dir, ill work on it later

I've tried it, mine seems working.. can you look at it commit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants