Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add files and commit #143

Merged
merged 5 commits into from
Dec 9, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/workflows/generate-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ jobs:
go-version: "1.20"
- name: Install Dependencies
run: go mod download

framework_matrix:
needs: install_dependencies
strategy:
Expand All @@ -28,6 +27,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Commit report
run: |
git config --global user.name 'BATMAN'
git config --global user.email 'BATMAN69@users.noreply.github.com'
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the BATMAN global username??

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's for the linter to pass the checks.

- name: build templates
run: go run main.go create -n ${{ matrix.framework }} -f ${{ matrix.framework}} -d ${{ matrix.driver }}
- name: golangci-lint
Expand Down
14 changes: 14 additions & 0 deletions cmd/program/program.go
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,20 @@ func (p *Project) CreateMainFile() error {
cobra.CheckErr(err)
}

// Git add files
err = utils.ExecuteCmd("git", []string{"add", "."}, projectPath)
if err != nil {
log.Printf("Error adding files to git repo: %v", err)
cobra.CheckErr(err)
return err
}
// Git commit files
err = utils.ExecuteCmd("git", []string{"commit", "-m", "Initial commit"}, projectPath)
if err != nil {
log.Printf("Error committing files to git repo: %v", err)
cobra.CheckErr(err)
return err
}
Melkeydev marked this conversation as resolved.
Show resolved Hide resolved
return nil
}

Expand Down
Loading