Skip to content

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

@bonelifer

Description

@bonelifer

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."

Metadata

Metadata

Assignees

Labels

internal-documentationPlace for me to describe what I want the script to do before I actual do anything.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions