Skip to content

Commit

Permalink
feat: add files and commit (#143)
Browse files Browse the repository at this point in the history
Adding initial commit to project spin up
  • Loading branch information
SudoSurya authored Dec 9, 2023
1 parent dc3d3a0 commit 2f1faad
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
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 @@ -27,6 +26,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Commit report
run: |
git config --global user.name 'testname'
git config --global user.email 'testemail@users.noreply.github.com'
- name: build templates
run: script -q /dev/null -c "go run main.go create -n ${{ matrix.framework }} -f ${{ matrix.framework}} -d ${{matrix.driver}}" /dev/null
- 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
}
return nil
}

Expand Down

0 comments on commit 2f1faad

Please sign in to comment.