Skip to content

Commit

Permalink
Add flag to disable version check (#1950)
Browse files Browse the repository at this point in the history
  • Loading branch information
adreed-msft committed Dec 1, 2022
1 parent ffbeb92 commit e653f23
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ var azcopyAwaitContinue bool
var azcopyAwaitAllowOpenFiles bool
var azcopyScanningLogger common.ILoggerResetable
var azcopyCurrentJobID common.JobID
var azcopySkipVersionCheck bool

type jobLoggerInfo struct {
jobID common.JobID
Expand Down Expand Up @@ -151,12 +152,14 @@ var rootCmd = &cobra.Command{
common.IncludeAfterFlagName, IncludeAfterDateFilter{}.FormatAsUTC(adjustedTime))
jobsAdmin.JobsAdmin.LogToJobLog(startTimeMessage, pipeline.LogInfo)

// spawn a routine to fetch and compare the local application's version against the latest version available
// if there's a newer version that can be used, then write the suggestion to stderr
// however if this takes too long the message won't get printed
// Note: this function is necessary for non-help, non-login commands, since they don't reach the corresponding
// beginDetectNewVersion call in Execute (below)
beginDetectNewVersion()
if !azcopySkipVersionCheck {
// spawn a routine to fetch and compare the local application's version against the latest version available
// if there's a newer version that can be used, then write the suggestion to stderr
// however if this takes too long the message won't get printed
// Note: this function is necessary for non-help, non-login commands, since they don't reach the corresponding
// beginDetectNewVersion call in Execute (below)
beginDetectNewVersion()
}

if debugSkipFiles != "" {
for _, v := range strings.Split(debugSkipFiles, ";") {
Expand Down Expand Up @@ -213,6 +216,8 @@ func init() {
rootCmd.PersistentFlags().StringVar(&cmdLineExtraSuffixesAAD, trustedSuffixesNameAAD, "", "Specifies additional domain suffixes where Azure Active Directory login tokens may be sent. The default is '"+
trustedSuffixesAAD+"'. Any listed here are added to the default. For security, you should only put Microsoft Azure domains here. Separate multiple entries with semi-colons.")

rootCmd.PersistentFlags().BoolVar(&azcopySkipVersionCheck, "skip-version-check", false, "Do not perform the version check at startup. Intended for automation scenarios & airgapped use.")

// Note: this is due to Windows not supporting signals properly
rootCmd.PersistentFlags().BoolVar(&cancelFromStdin, "cancel-from-stdin", false, "Used by partner teams to send in `cancel` through stdin to stop a job.")

Expand Down

0 comments on commit e653f23

Please sign in to comment.