Code Monkey home page Code Monkey logo

Comments (4)

twpayne avatar twpayne commented on June 19, 2024 1

bin/starship and bin/fastfetch are missing

    executable = true

in your .chezmoiexternal.toml file.

Wait, that's not correct.

from chezmoi.

bradenhilton avatar bradenhilton commented on June 19, 2024
docker run -it alpine:latest
/ # apk update
...
OK: 22982 distinct packages available
/ # apk add curl
...
OK: 12 MiB in 23 packages
/ # apk add neovim
...
OK: 34 MiB in 34 packages
/ # sh -c "$(curl -fsLS get.chezmoi.io)"
info found version 2.46.1 for latest/linux/amd64
info installed ./bin/chezmoi
/ # chezmoi init
/ # cd $(chezmoi source-path)
~/.local/share/chezmoi # nvim .chezmoiexternal.toml
~/.local/share/chezmoi # cat .chezmoiexternal.toml
{{- if eq .chezmoi.os "linux" }}
["bin/starship"]
    type = "archive-file"
    url = "https://github.com/starship/starship/releases/latest/download/starship-x86_64-unknown-linux-gnu.tar.gz"
    path = "starship"
["bin/fastfetch"]
    type = "archive-file"
    url = "https://github.com/fastfetch-cli/fastfetch/releases/latest/download/fastfetch-linux-x86_64.zip"
    path = "fastfetch-linux-x86_64/usr/bin/fastfetch"
{{- end }}
~/.local/share/chezmoi # nvim .chezmoiignore
~/.local/share/chezmoi # cat .chezmoiignore
README.md
{{- if ne .chezmoi.os "linux" }}
bin/fastfetch
bin/starship
{{- end }}
~/.local/share/chezmoi # chezmoi apply
~/.local/share/chezmoi # cd
~ # chezmoi add ./bin
~ # chezmoi managed
chezmoi: bin/fastfetch: inconsistent state (/root/.local/share/chezmoi/bin/executable_fastfetch, https://github.com/fastfetch-cli/fastfetch/releases/latest/download/fastfetch-linux-x86_64.zip defined in /root/.local/share/chezmoi/.chezmoiexternal.toml)
bin/starship: inconsistent state (/root/.local/share/chezmoi/bin/executable_starship, https://github.com/starship/starship/releases/latest/download/starship-x86_64-unknown-linux-gnu.tar.gz defined in /root/.local/share/chezmoi/.chezmoiexternal.toml)

from chezmoi.

mbologna avatar mbologna commented on June 19, 2024
~ # chezmoi add ./bin
~ # chezmoi managed
chezmoi: bin/fastfetch: inconsistent state (/root/.local/share/chezmoi/bin/executable_fastfetch, https://github.com/fastfetch-cli/fastfetch/releases/latest/download/fastfetch-linux-x86_64.zip defined in /root/.local/share/chezmoi/.chezmoiexternal.toml)
bin/starship: inconsistent state (/root/.local/share/chezmoi/bin/executable_starship, https://github.com/starship/starship/releases/latest/download/starship-x86_64-unknown-linux-gnu.tar.gz defined in /root/.local/share/chezmoi/.chezmoiexternal.toml)

Yes, I reproduced it with alpine as well:

~/.local/share/chezmoi # git status 
On branch master
nothing to commit, working tree clean
~/.local/share/chezmoi # tree .
.
└── bin
    ├── bar
    └── foo

1 directories, 2 files
~/.local/share/chezmoi # cat .chezmoiexternal.toml .chezmoiignore 
{{- if eq .chezmoi.os "linux" }}
["bin/starship"]
    type = "archive-file"
    url = "https://github.com/starship/starship/releases/latest/download/starship-x86_64-unknown-linux-gnu.tar.gz"
    path = "starship"
["bin/fastfetch"]
    type = "archive-file"
    url = "https://github.com/fastfetch-cli/fastfetch/releases/latest/download/fastfetch-linux-x86_64.zip"
    path = "fastfetch-linux-x86_64/usr/bin/fastfetch"
{{- end }}
README.md
{{- if ne .chezmoi.os "linux" }}
bin/fastfetch
bin/starship
{{- end }}
~/.local/share/chezmoi # tree ~/bin/
/root/bin/
├── bar
├── fastfetch
├── foo
└── starship

0 directories, 4 files
~/.local/share/chezmoi # chezmoi add ~/bin/
~/.local/share/chezmoi # chezmoi managed
chezmoi: bin/fastfetch: inconsistent state (/root/.local/share/chezmoi/bin/executable_fastfetch, https://github.com/fastfetch-cli/fastfetch/releases/latest/download/fastfetch-linux-x86_64.zip defined in /root/.local/share/chezmoi/.chezmoiexternal.toml)
bin/starship: inconsistent state (/root/.local/share/chezmoi/bin/executable_starship, https://github.com/starship/starship/releases/latest/download/starship-x86_64-unknown-linux-gnu.tar.gz defined in /root/.local/share/chezmoi/.chezmoiexternal.toml)
~/.local/share/chezmoi # git status 
On branch master
Untracked files:
  (use "git add <file>..." to include in what will be committed)
        bin/executable_fastfetch
        bin/executable_starship

nothing added to commit but untracked files present (use "git add" to track)

from chezmoi.

twpayne avatar twpayne commented on June 19, 2024

Under the hood, this is the same issue as #1574.

Note that bin/starship and bin/fastfetch are not ignored. They're only ignored on non-Linux machines.

What's happening here is that two files which are already defined in .chezmoiexternal.toml are also being added with chezmoi add, and the resulting state is inconsistent.

chezmoi should not allow files to be added if they're already defined as externals. I'll update the description of #1574.

from chezmoi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.