#!/bin/bash if [ -z "$1" ]; then printf "\nUsage:\n\n> curl -s https://raw.githubusercontent.com/jeremy-step/get-helm-web-dev/main/download.sh | bash -s \n" exit 1 fi latest_tag=$(curl -s https://api.github.com/repos/jeremy-step/helm-web-dev/releases/latest | sed -Ene '/^ *"tag_name": *"(v.+)",$/s//\1/p') printf "\nDownloading version $latest_tag...\n" url="https://github.com/jeremy-step/helm-web-dev/archive/$latest_tag.tar.gz" if [ "$1" = "." ]; then curl -sL "$url" | tar xz --strip-components=1 -C . else mkdir -p "$1" && curl -sL "$url" | tar xz --strip-components=1 -C "$1" fi cp "$1/.helm/.env.example" "$1/.helm/.env" printf "\nYou are ready to start developing your new project!\n" if [ "$1" != "." ]; then printf -- "\n------\n\nTo go to the project directory, run:\n\n> cd $1\n" fi printf -- "\n------\n\nCheck out the README.md to see how to manage the Docker services.\n" exit 0