Skip to content

Adding Install.sh from the repository #168

@seymourpoler

Description

@seymourpoler

Hi, there
First of all, many thanks for all the effort involed, I think that this programming language is amazing and it has a brilliant future.
I have installed the lastest release of this programming language from the repository in my linux x64 machine, but I think that it could be automatized.
Here is the script in bash only for linux-amd64.

#!/bin/bash

# Exit on error
set -e

# Get latest release URL for linux-amd64 from GitHub API
echo "Fetching latest linux-amd64 release info..."
LATEST_URL=$(curl -s https://api.github.com/repos/nature-lang/nature/releases/latest \
  | grep "browser_download_url.*linux-amd64.*tar.gz" \
  | cut -d '"' -f 4)

if [ -z "$LATEST_URL" ]; then
  echo "❌ Could not find linux-amd64 release URL."
  exit 1
fi

echo "Latest release URL: $LATEST_URL"

# Download the tar.gz file
echo "Downloading Nature..."
curl -L "$LATEST_URL" -o nature.tar.gz

# Extract to /usr/local
echo "Extracting to /usr/local..."
sudo tar -xzf nature.tar.gz -C /usr/local

# Clean up
rm nature.tar.gz

# Add to PATH if not already present
if ! grep -q "/usr/local/nature/bin" ~/.bashrc; then
  echo "Updating PATH..."
  echo 'export PATH="/usr/local/nature/bin:$PATH"' >> ~/.bashrc
  source ~/.bashrc
else
  echo "PATH already includes /usr/local/nature/bin"
fi

echo "✅ Nature installed and ready to use!"

Many thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions