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

Create ~/bin depending on permissions yes/no dialog #25

Open
bonelifer opened this issue Apr 1, 2024 · 0 comments
Open

Create ~/bin depending on permissions yes/no dialog #25

bonelifer opened this issue Apr 1, 2024 · 0 comments
Assignees
Labels
internal-documentation Place for me to describe what I want the script to do before I actual do anything.

Comments

@bonelifer
Copy link
Owner

If yes, then keep the current directory:
~/bin or /usr/local/sbin

If no, and using local permission do

#!/bin/bash

# Create a 'bin' directory in your home directory if it doesn't exist
mkdir -p ~/bin

# Add the 'bin' directory to your PATH if not already added
if [[ ":$PATH:" != *":$HOME/bin:"* ]]; then
    echo 'export PATH="$PATH:$HOME/bin"' >> ~/.bashrc
fi

# Apply changes to the current session
source ~/.bashrc

echo "Setup complete. 'bin' directory added to PATH."

@bonelifer bonelifer self-assigned this Apr 1, 2024
@bonelifer bonelifer added the internal-documentation Place for me to describe what I want the script to do before I actual do anything. label Apr 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
internal-documentation Place for me to describe what I want the script to do before I actual do anything.
Projects
None yet
Development

No branches or pull requests

1 participant