Skip to content

Commit

Permalink
refactor: used a new ignore module
Browse files Browse the repository at this point in the history
  • Loading branch information
hosekpeter committed Nov 11, 2024
1 parent 920869a commit a4ca901
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion internal/pkg/service/cli/cmd/sync/pull/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func Command(p dependencies.Provider) *cobra.Command {
// Options
options := pull.Options{
DryRun: f.DryRun.Value,
LogUntrackedPaths: true,
LogUntrackedPaths: false,
}

// Send cmd successful/failed event
Expand Down
13 changes: 10 additions & 3 deletions pkg/lib/operation/project/sync/pull/operation.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"github.com/keboola/keboola-as-code/internal/pkg/plan/pull"
"github.com/keboola/keboola-as-code/internal/pkg/project"
"github.com/keboola/keboola-as-code/internal/pkg/project/cachefile"
"github.com/keboola/keboola-as-code/internal/pkg/state/registry"
"github.com/keboola/keboola-as-code/internal/pkg/project/ignore"
"github.com/keboola/keboola-as-code/internal/pkg/telemetry"
"github.com/keboola/keboola-as-code/internal/pkg/utils/errors"
saveManifest "github.com/keboola/keboola-as-code/pkg/lib/operation/project/local/manifest/save"
Expand Down Expand Up @@ -50,10 +50,17 @@ func Run(ctx context.Context, projectState *project.State, o Options, d dependen

logger := d.Logger()

if projectState.Fs().Exists(ctx, registry.KBCIgnoreFilePath) {
if err := projectState.SetIgnoredConfigsOrRows(ctx, projectState.Fs(), registry.KBCIgnoreFilePath); err != nil {
if projectState.Fs().Exists(ctx, ignore.KBCIgnoreFilePath) {
// Load ignore file
file, err := ignore.LoadFile(ctx, projectState.Fs(), projectState.Registry, ignore.KBCIgnoreFilePath)
if err != nil {
return err
}

if err = file.IgnoreConfigsOrRows(); err != nil {
return err
}

ignoreConfigsAndRows(projectState)
}

Expand Down

0 comments on commit a4ca901

Please sign in to comment.