GithubHelp home page GithubHelp logo

bash setup about dotfiles HOT 4 CLOSED

fatso83 avatar fatso83 commented on July 23, 2024 1
bash setup

from dotfiles.

Comments (4)

afreisinger avatar afreisinger commented on July 23, 2024 1

Work form me !!!
sudo chown -R $USER /usr/local/* and then re-run
Thanks a lot !

from dotfiles.

fatso83 avatar fatso83 commented on July 23, 2024 1

This is not the most advanced dotfiles in the world and if you are using ZSH, then you can find lots of other dotfiles repos with much fancier setup, but I chose to use my own after trying ones I did not understand and that were basically too complicated for me, using features I did not want or did not know I wanted ...

The good thing about this setup is that it is very easy to understand and modify for your own needs (copying cool stuff from other places), and it is also easy to have a common base that works on a lot of operating systems (having the same utility functions and aliases), while allowing customizing for each platform independently. For instance, I love that I can do cat file | pbcopy to copy a file into my paste-buffer and know that it works on Windows, Mac and Linux. Hope you find something useful/interesting in here and you build your own custom thing on top :)

from dotfiles.

fatso83 avatar fatso83 commented on July 23, 2024

Whoa 😱 That does not sound so hot. I have just run the dotfiles setup on a fresh new M1 Macbook, and I think I did not do anything special (beside re-running it a few times, as not all utils are present on first run) and I definitely did not see any errors like that.

When I see stuff like Bad file descriptor I am immediately tempted to say "File system corruption", but the reason is probably something much less severe. As in, could the reason be something as basic as missing file permissions on /usr/local? I think that would explain most of your issues and it might be that I have just done that step without thinking about it.

This is how my own permissions look:

carlerik at carl-eriks-air in ~/dev/dotfiles (master)
$ ls -lh /usr/local
total 0
drwxr-xr-x  72 root      wheel   2,3K  1 aug 13:53 aws-cli
drwxr-xr-x  29 carlerik  wheel   928B  2 sep 10:29 bin
drwxr-xr-x   3 carlerik  wheel    96B 30 jul 00:15 include
drwxr-xr-x   5 carlerik  wheel   160B  1 aug 17:01 lib
drwxr-xr-x   5 root      wheel   160B 12 jul 12:01 libexec
drwxr-xr-x   3 carlerik  wheel    96B 30 jul 00:13 n
drwxr-xr-x   5 carlerik  wheel   160B 30 jul 00:15 share

carlerik at carl-eriks-air in ~/dev/dotfiles (master)
$ ls -lhd /usr/local
drwxr-xr-x  9 root  wheel   288B  2 aug 17:32 /usr/local

By default, /usr/local and all its subdirs are owned by root. Then all installations will fail to put anything in there, including stuff like n (the Node version chooser). I think Homebrew might change this when installing it, so either I used brew install <someapp> before running my dotfiles or I fixed the permissions myself.

I would try sudo chown -R $USER /usr/local/* and then re-run.

Regarding the bash prompt error: __git_ps1: command not found. This is caused by the $PS1 environment variable, which controls how the prompt should look like. It executes a command called __git_ps1, which needs to be present in your shell. This is supposed to be taken care of automatically ... so something is definitely not working on your setup.

So the commands are sourced from this file. It is being read at startup by bashrc. So I am pretty sure you should be seeing errors both during setup and when starting up, as it seems the files have not been copied over.

If you enter the dotfiles repo and run ./common-setup/setup.sh, what happens?

On my Macbook this is what happens:

carlerik at carl-eriks-air in ~/dev/dotfiles (master)
$ ./setup.sh
Installing common setup
Installing all VIM plugins(might take some time the first time ... )
Fetching rupa/z (Jump Around)
Finished common setup

Install config specific to this machine
Setting up local settings for this machine
Installing local apps using Homebrew ...
finished
 You might need to re-run the global setup as build tools might not have been available
Adding scripts and binary utilities
Requirement already satisfied: pip in /Users/carlerik/Library/Python/3.9/lib/python/site-packages (21.2.4)
Requirement already satisfied: smsutil in /Users/carlerik/Library/Python/3.9/lib/python/site-packages (1.1.3)
Requirement already satisfied: future>=0.16.0 in /Users/carlerik/Library/Python/3.9/lib/python/site-packages (from smsutil) (0.18.2)
Requirement already satisfied: requests in /Users/carlerik/Library/Python/3.9/lib/python/site-packages (2.26.0)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in /Users/carlerik/Library/Python/3.9/lib/python/site-packages (from requests) (1.26.6)
Requirement already satisfied: charset-normalizer~=2.0.0 in /Users/carlerik/Library/Python/3.9/lib/python/site-packages (from requests) (2.0.3)
Requirement already satisfied: certifi>=2017.4.17 in /Users/carlerik/Library/Python/3.9/lib/python/site-packages (from requests) (2021.5.30)
Requirement already satisfied: idna<4,>=2.5 in /Users/carlerik/Library/Python/3.9/lib/python/site-packages (from requests) (3.2)

from dotfiles.

fatso83 avatar fatso83 commented on July 23, 2024

The tips above was for debugging the installation, but when you have installed everything without errors, one way of debugging the Bash setup is to do DEBUG=1 source-rc. It will print out lots of info while reading the config

from dotfiles.

Related Issues (6)

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.