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

newt: Add ignore flag for upgrade command #573

Merged
merged 1 commit into from
Oct 24, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 2 additions & 0 deletions newt/cli/project_cmds.go
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,8 @@ func AddProjectCommands(cmd *cobra.Command) {
"Force upgrade of the repositories to latest state in project.yml")
upgradeCmd.PersistentFlags().BoolVarP(&newtutil.NewtAsk,
"ask", "a", false, "Prompt user before upgrading any repos")
upgradeCmd.PersistentFlags().StringSliceVarP(&newtutil.NewtIgnore, "ignore", "i", []string{},
"Names of repositories to skip, separated by a comma or by using multiple flags")

cmd.AddCommand(upgradeCmd)

Expand Down
1 change: 1 addition & 0 deletions newt/newtutil/newtutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ var NewtBlinkyTag string = "master"
var NewtNumJobs int
var NewtForce bool
var NewtAsk bool
var NewtIgnore []string

const CORE_REPO_NAME string = "apache-mynewt-core"
const ARDUINO_ZERO_REPO_NAME string = "mynewt_arduino_zero"
Expand Down
1 change: 1 addition & 0 deletions newt/project/project.go
Original file line number Diff line number Diff line change
Expand Up @@ -634,6 +634,7 @@ func (proj *Project) loadConfig(download bool) error {
proj.reposIgnored = make([]string, 0)
proj.reposIgnored, err = yc.GetValStringSlice("project.repositories.ignored", nil)
util.OneTimeWarningError(err)
proj.reposIgnored = append(proj.reposIgnored, newtutil.NewtIgnore...)

if util.SliceContains(proj.reposIgnored, "apache-mynewt-core") {
return util.NewNewtError("apache-mynewt-core repository can't be ignored. " +
Expand Down
Loading