awslabs / aws-terraform-dev-container

A VSCode Dev Container with tools to help you build and manage AWS infrastructure with Terraform
MIT No Attribution
133 stars 20 forks source link

Fix init.sh when running not in git repo #10

Open VisualDudek opened 1 year ago

VisualDudek commented 1 year ago

NOTICE: this is my first issue ever

Description: When you run curl -sL https://raw.githubusercontent.com/awslabs/aws-terraform-dev-container/main/scripts/init.sh | bash according to Getting Started BUT not from git repo, than line 12 from init.sh will fail due to git submodule cannot be run outside git repo.

line 12 from inti.sh git submodule add --name habits -b main https://github.com/awslabs/aws-code-habits.git habits

Steps to Reproduce:

cd /tmp
cd `mktemp -d`
curl -sL https://raw.githubusercontent.com/awslabs/aws-terraform-dev-container/main/scripts/init.sh | bash

output:

Cloning into 'aws-terraform-dev-container'...
remote: Enumerating objects: 48, done.
remote: Counting objects: 100% (48/48), done.
remote: Compressing objects: 100% (45/45), done.
remote: Total 48 (delta 0), reused 29 (delta 0), pack-reused 0
Receiving objects: 100% (48/48), 2.02 MiB | 3.63 MiB/s, done.
fatal: not a git repository (or any of the parent directories): .git

last line indicates on error wihile trying to git submodule

Environment: 22.04.1-Ubuntu

Comments: I will create pull request that will enabales to clone habits even while not being in git repo (.git dir not found).