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

Plugin Execution on MacOS #41

Open
ShaikhDanish04 opened this issue Nov 23, 2024 · 1 comment
Open

Plugin Execution on MacOS #41

ShaikhDanish04 opened this issue Nov 23, 2024 · 1 comment

Comments

@ShaikhDanish04
Copy link

To run the plugin on MacOS we required some customizations please merge it if possible

LNAME and UNAME was returning blank causing the issue

# Check if running on macOS
if [[ "$(uname)" == "Darwin" ]]; then
    # Use tr for macOS
    NAME=$(echo "$1" | tr -dc 'a-zA-Z')
    LNAME=$(echo "$NAME" | tr '[:upper:]' '[:lower:]')  # Convert to lowercase
    UNAME=$(echo "$NAME" | tr '[:lower:]' '[:upper:]')  # Convert to uppercase
else
    # Use Bash 4+ syntax for other systems
    NAME=$(echo "$1" | tr -dc '[[:alpha:]]')
    LNAME=${NAME,,}  # Convert to lowercase
    UNAME=${NAME^^}  # Convert to uppercase
fi

Replacement was failing and getting new files with names as hook.phpsetup.php etc

# Check if running on macOS
if [[ "$(uname)" == "Darwin" ]]; then
    # Use tr for macOS
    sed \
    -e "s/{NAME}/$NAME/g" \
    -e "s/{LNAME}/$LNAME/g" \
    -e "s/{UNAME}/$UNAME/g" \
    -e "s/{VERSION}/$VERSION/g" \
    -e "s/{YEAR}/$YEAR/g" \
    -i '' setup.php hook.php $LNAME.xml tools/HEADER README.md
else
    # Use Bash 4+ syntax for other systems
    sed \
    -e "s/{NAME}/$NAME/" \
    -e "s/{LNAME}/$LNAME/" \
    -e "s/{UNAME}/$UNAME/" \
    -e "s/{VERSION}/$VERSION/" \
    -e "s/{YEAR}/$YEAR/" \
    -i setup.php hook.php $LNAME.xml tools/HEADER README.md
fi
@ShaikhDanish04 ShaikhDanish04 changed the title Plugin Exeuction on MacOS Plugin Execution on MacOS Nov 23, 2024
@stonebuzz
Copy link

Hi @ShaikhDanish04

can you suggest a PR?

Best regards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants