@@ -25,6 +25,11 @@ import {
25
25
} from '../utils/command-helpers.mjs'
26
26
import getGlobalConfig from '../utils/get-global-config.mjs'
27
27
import openBrowser from '../utils/open-browser.mjs'
28
+ import {
29
+ warnForDeprecatedOptions ,
30
+ deprecatedArgParser ,
31
+ returnDeprecatedOptionValue ,
32
+ } from '../utils/option-deprecation.mjs'
28
33
import StateConfig from '../utils/state-config.mjs'
29
34
import { identify , track } from '../utils/telemetry/index.mjs'
30
35
@@ -99,13 +104,20 @@ export default class BaseCommand extends Command {
99
104
. addOption ( new Option ( '--cwd <cwd>' ) . hideHelp ( true ) )
100
105
. addOption ( new Option ( '-o, --offline' ) . hideHelp ( true ) )
101
106
. addOption ( new Option ( '--auth <token>' , 'Netlify auth token' ) . hideHelp ( true ) )
107
+ // TODO v13: remove this deprecated command
108
+ . addOption (
109
+ new Option ( '--httpProxy [address]' , '[DEPRECATED IN V13] Proxy server address to route requests through.' )
110
+ . default ( process . env . HTTP_PROXY || process . env . HTTPS_PROXY )
111
+ . hideHelp ( true )
112
+ . argParser ( deprecatedArgParser ) ,
113
+ )
102
114
. option (
103
115
'--httpProxyCertificateFilename [file]' ,
104
116
'Certificate file to use when connecting using a proxy server' ,
105
117
process . env . NETLIFY_PROXY_CERTIFICATE_FILENAME ,
106
118
)
107
119
. option (
108
- '--httpProxy [address]' ,
120
+ '--http-proxy [address]' ,
109
121
'Proxy server address to route requests through.' ,
110
122
process . env . HTTP_PROXY || process . env . HTTPS_PROXY ,
111
123
)
@@ -117,6 +129,11 @@ export default class BaseCommand extends Command {
117
129
await this . init ( actionCommand )
118
130
debug ( `${ name } :preAction` ) ( 'end' )
119
131
} )
132
+ . hook ( 'preAction' , ( parentCommand ) => {
133
+ const options = parentCommand . opts ( )
134
+ if ( ! options ) return
135
+ warnForDeprecatedOptions ( options )
136
+ } )
120
137
)
121
138
}
122
139
@@ -419,8 +436,9 @@ export default class BaseCommand extends Command {
419
436
const cachedConfig = await actionCommand . getConfig ( { cwd, state, token, ...apiUrlOpts } )
420
437
const { buildDir, config, configPath, repositoryRoot, siteInfo } = cachedConfig
421
438
const normalizedConfig = normalizeConfig ( config )
439
+
422
440
const agent = await getAgent ( {
423
- httpProxy : options . httpProxy ,
441
+ httpProxy : returnDeprecatedOptionValue ( options . httpProxy ) ,
424
442
certificateFile : options . httpProxyCertificateFilename ,
425
443
} )
426
444
const apiOpts = { ...apiUrlOpts , agent }
0 commit comments