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

OS detection fails in non-systemd distributions #24

Closed
usrbinpikachu opened this issue Sep 11, 2020 · 7 comments
Closed

OS detection fails in non-systemd distributions #24

usrbinpikachu opened this issue Sep 11, 2020 · 7 comments
Labels
🐛 bug Something isn't working

Comments

@usrbinpikachu
Copy link

usrbinpikachu commented Sep 11, 2020

Describe the bug

cat: /etc/os-release: No such file or directory
math: Expected at least 1 args, got 0
cat: /etc/os-release: No such file or directory
math: Expected at least 1 args, got 0
Welcome to fish, the friendly interactive shell
Type help for instructions on how to use fish

Steps to reproduce

  1. Launch new shell

Expected behavior

OS detection should check for /etc/lsb-release if /etc/os-release is not present

Screenshots

function _tide_detect_os_extract_os_release_info -a key
    set -l splitOsRelease (cat /etc/os-release | string split '=')
    set -l value $splitOsRelease[(math (contains --index $key $splitOsRelease)+1)]

    string trim --chars='"' $value | string lower
end

Environment (please complete the following information)

  • Operating System: Artix
  • Output of tide bug-report:
fish, version 3.1.2
tide, version 2.3.0
xterm-256color

Additional context

@usrbinpikachu usrbinpikachu added the 🐛 bug Something isn't working label Sep 11, 2020
@usrbinpikachu
Copy link
Author

usrbinpikachu commented Sep 11, 2020

Changing the function to the following at least eliminates the error about /etc/os-release:

function _tide_detect_os_extract_os_release_info -a key
    if test -e /etc/os-release
      set -l splitOsRelease (cat /etc/os-release | string split '=')
    else
      set -l splitOsRelease (cat /etc/lsb-release | string split '=')
    end
    set -l value $splitOsRelease[(math (contains --index $key $splitOsRelease)+1)]

    string trim --chars='"' $value | string lower
end

@IlanCosman
Copy link
Owner

IlanCosman commented Sep 11, 2020

Powerlevel10k actually treats Artix specially.
https://github.com/romkatv/powerlevel10k/blob/a3727dcaefbfba04484ba0f979c62d070850eeed/internal/wizard.zsh#L1069-L1071

I'll look into this and think about the best way to deal with it; I've never used a non-systemd distro. Thanks for the report 😄

Until then I suppose you'll just have to use your fix or comment _tide_detect_os out in _tide_init.

@IlanCosman
Copy link
Owner

Hi @kudakeru, can you try installing Tide from the lsb-release branch to check if the issue has been fixed?

curl -sL git.io/tide | source && tide_install lsb-release

@usrbinpikachu
Copy link
Author

Installed and tested. Everything looks like it's working now.

@IlanCosman
Copy link
Owner

Great to hear, thanks for filing this issue @kudakeru 😄

@tdcook
Copy link

tdcook commented Feb 8, 2021

This appears to have resurfaced after edcc4f0.

@IlanCosman
Copy link
Owner

Thanks 👍

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 12, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🐛 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants