You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by GitBox <gi...@apache.org> on 2018/09/24 18:28:25 UTC

[GitHub] utzig closed pull request #215: Fix usage of -f on target delete/init commands

utzig closed pull request #215: Fix usage of -f on target delete/init commands
URL: https://github.com/apache/mynewt-newt/pull/215
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/newt/cli/target_cmds.go b/newt/cli/target_cmds.go
index 91b0b598..c4f084bf 100644
--- a/newt/cli/target_cmds.go
+++ b/newt/cli/target_cmds.go
@@ -40,7 +40,6 @@ import (
 	"mynewt.apache.org/newt/util"
 )
 
-var targetForce bool = false
 var amendDelete bool = false
 
 // target variables that can have values amended with the amend command.
@@ -455,7 +454,7 @@ func targetCreateCmd(cmd *cobra.Command, args []string) {
 }
 
 func targetDelOne(t *target.Target) error {
-	if !targetForce {
+	if !newtutil.NewtForce {
 		// Determine if the target directory contains extra user files.  If it
 		// does, a prompt (or force) is required to delete it.
 		userFiles, err := targetContainsUserFiles(t)
@@ -596,7 +595,7 @@ func printBriefSetting(entry syscfg.CfgEntry) {
 		extras = append(extras, s)
 	}
 
-	if len(extras) > 0{
+	if len(extras) > 0 {
 		util.StatusMessage(util.VERBOSITY_DEFAULT, " (%s)",
 			strings.Join(extras, ", "))
 	}
@@ -816,7 +815,7 @@ func targetConfigInitCmd(cmd *cobra.Command, args []string) {
 		}
 	}
 
-	if anyExist && !targetForce {
+	if anyExist && !newtutil.NewtForce {
 		util.StatusMessage(util.VERBOSITY_DEFAULT,
 			"Configuration files already exist:\n")
 		for _, e := range entries {


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services