Skip to content

Commit

Permalink
GitAuto: [FEATURE] Installation script for this template (PowerShell …
Browse files Browse the repository at this point in the history
…and Bash) (#45)

* Update install.ps1.

* Update install.sh.

* Update install.sh

---------

Co-authored-by: gitauto-ai[bot] <161652217+gitauto-ai[bot]@users.noreply.github.com>
Co-authored-by: gstraccini[bot] <150967461+gstraccini[bot]@users.noreply.github.com>
Co-authored-by: Guilherme Branco Stracini <[email protected]>
  • Loading branch information
3 people authored Sep 21, 2024
1 parent b658fdb commit cd99a9c
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 0 deletions.
34 changes: 34 additions & 0 deletions install.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
Param(
[string]$ProjectName,
[string]$Namespace,
[string]$SonarCloudUrl,
[string]$HealthChecksId
)

Write-Host "Setting up project: $ProjectName"

# Update .wakatime and README.md
(Get-Content .wakatime-project) -replace 'TemplateProject', $ProjectName | Set-Content .wakatime-project
(Get-Content README.md) -replace 'TemplateProject', $ProjectName | Set-Content README.md

# Update composer.json
(Get-Content composer.json) -replace 'TemplateNamespace', $Namespace | Set-Content composer.json

# Update Healthchecks.io badge
Write-Host "Please create a HealthChecks.io account if needed."
(Get-Content README.md) -replace 'HealthChecksId', $HealthChecksId | Set-Content README.md

# Update SonarCloud URL
(Get-Content README.md) -replace 'SonarCloudUrl', $SonarCloudUrl | Set-Content README.md

# Run composer install
Write-Host "Running composer install..."
composer install

Write-Host "Project setup complete."

# Additional PHP setup tasks
Write-Host "Performing additional PHP setup tasks..."
# Add any additional setup commands here

Write-Host "Setup finished successfully."
41 changes: 41 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/bin/bash

echo "Enter the project name:"
read -r project_name

echo "Enter the default namespace:"
read -r namespace

echo "Enter the SonarCloud URL:"
read -r sonarcloud_url

echo "Enter the HealthChecks.io ID:"
read -r healthchecks_id

echo "Setting up project: $project_name"

# Update .wakatime and README.md
sed -i "s/TemplateProject/$project_name/g" .wakatime-project
sed -i "s/TemplateProject/$project_name/g" README.md

# Update composer.json
sed -i "s/TemplateNamespace/$namespace/g" composer.json

# Update Healthchecks.io badge
echo "Please create a HealthChecks.io account if needed."
sed -i "s/HealthChecksId/$healthchecks_id/g" README.md

# Update SonarCloud URL
sed -i "s|SonarCloudUrl|$sonarcloud_url|g" README.md

# Run composer install
echo "Running composer install..."
composer install

echo "Project setup complete."

# Additional PHP setup tasks
echo "Performing additional PHP setup tasks..."
# Add any additional setup commands here

echo "Setup finished successfully."

0 comments on commit cd99a9c

Please sign in to comment.