Skip to content

Commit

Permalink
Merge pull request #6 from priyashpatil/fix/mac-install-script
Browse files Browse the repository at this point in the history
Fix/mac install script
  • Loading branch information
priyashpatil authored Oct 17, 2024
2 parents 8007ddf + 929a6e5 commit 6e23711
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

phpup - CLI tool for managing PHP environments

## Installation

macOS

```sh
curl -fsSL https://raw.githubusercontent.com/priyashpatil/phpup/main/install/mac.sh | bash
```

## Roadmap

- [ ] Easy to install cross platform script
Expand Down
11 changes: 6 additions & 5 deletions install/mac.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,21 @@ fi
RELEASE_TAG=$(curl -s "https://api.github.com/repos/$REPO_OWNER/$REPO_NAME/releases/latest" |
grep -o '"tag_name": "[^"]*' | sed 's/"tag_name": "//')

# Echo which version is being downloaded
echo -e "Downloading phpup version $RELEASE_TAG \n"

# Get the download URL for the asset
DOWNLOAD_URL=$(curl -s "https://api.github.com/repos/$REPO_OWNER/$REPO_NAME/releases/tags/$RELEASE_TAG" |
grep -o "https://github.com/$REPO_OWNER/$REPO_NAME/releases/download/$RELEASE_TAG/$ASSET_NAME")

# Echo which version is being downloaded
echo "Downloading phpup version $RELEASE_TAG"

# Download the asset
curl -L -o "$ASSET_NAME" "$DOWNLOAD_URL"

# Make the binary executable
chmod +x "$ASSET_NAME"

# Move the binary to a directory in PATH
# sudo mv "$ASSET_NAME" /usr/local/bin/phpup
echo -e "\nInstalling phpup to /usr/local/bin/phpup"
sudo mv "$ASSET_NAME" /usr/local/bin/phpup

echo "phpup has been installed successfully!"
echo -e "\nphpup has been installed successfully! 🎉"

0 comments on commit 6e23711

Please sign in to comment.