@@ -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,19 @@ 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
+ . addOption (
108
+ new Option ( '--httpProxy [address]' , '[DEPRECATED IN V13] Proxy server address to route requests through.' )
109
+ . default ( process . env . HTTP_PROXY || process . env . HTTPS_PROXY )
110
+ . hideHelp ( true )
111
+ . argParser ( deprecatedArgParser ) ,
112
+ )
102
113
. option (
103
114
'--httpProxyCertificateFilename [file]' ,
104
115
'Certificate file to use when connecting using a proxy server' ,
105
116
process . env . NETLIFY_PROXY_CERTIFICATE_FILENAME ,
106
117
)
107
118
. option (
108
- '--httpProxy [address]' ,
119
+ '--http-proxy [address]' ,
109
120
'Proxy server address to route requests through.' ,
110
121
process . env . HTTP_PROXY || process . env . HTTPS_PROXY ,
111
122
)
@@ -117,6 +128,11 @@ export default class BaseCommand extends Command {
117
128
await this . init ( actionCommand )
118
129
debug ( `${ name } :preAction` ) ( 'end' )
119
130
} )
131
+ . hook ( 'preAction' , ( parentCommand ) => {
132
+ const options = parentCommand . opts ( )
133
+ if ( ! options ) return
134
+ warnForDeprecatedOptions ( options )
135
+ } )
120
136
)
121
137
}
122
138
@@ -420,7 +436,7 @@ export default class BaseCommand extends Command {
420
436
const { buildDir, config, configPath, repositoryRoot, siteInfo } = cachedConfig
421
437
const normalizedConfig = normalizeConfig ( config )
422
438
const agent = await getAgent ( {
423
- httpProxy : options . httpProxy ,
439
+ httpProxy : returnDeprecatedOptionValue ( options . httpProxy ) ,
424
440
certificateFile : options . httpProxyCertificateFilename ,
425
441
} )
426
442
const apiOpts = { ...apiUrlOpts , agent }
0 commit comments