|
13 | 13 | // limitations under the License. |
14 | 14 |
|
15 | 15 | import * as minimist from 'minimist'; |
16 | | -import * as semver from 'semver'; |
17 | 16 | import {resolve} from 'path'; |
18 | 17 | import {SignatureType, isValidSignatureType} from './types'; |
19 | 18 |
|
@@ -141,24 +140,23 @@ const IgnoredRoutesOption = new ConfigurableOption<string | null>( |
141 | 140 | ); |
142 | 141 |
|
143 | 142 | export const requiredNodeJsVersionForLogExecutionID = '13.0.0'; |
| 143 | + |
| 144 | +export const logExecutionIdSupported = |
| 145 | + Number(process.versions.node.split('.', 1)[0]) >= 13; |
| 146 | + |
144 | 147 | const ExecutionIdOption = new ConfigurableOption( |
145 | 148 | 'log-execution-id', |
146 | 149 | 'LOG_EXECUTION_ID', |
147 | 150 | false, |
148 | 151 | x => { |
149 | | - const nodeVersion = process.versions.node; |
150 | | - const isVersionSatisfied = semver.gte( |
151 | | - nodeVersion, |
152 | | - requiredNodeJsVersionForLogExecutionID, |
153 | | - ); |
154 | 152 | const isTrue = |
155 | 153 | (typeof x === 'boolean' && x) || |
156 | 154 | (typeof x === 'string' && x.toLowerCase() === 'true'); |
157 | | - if (isTrue && !isVersionSatisfied) { |
| 155 | + if (isTrue && !logExecutionIdSupported) { |
158 | 156 | console.warn( |
159 | 157 | `Execution id is only supported with Node.js versions |
160 | 158 | ${requiredNodeJsVersionForLogExecutionID} and above. Your |
161 | | - current version is ${nodeVersion}. Please upgrade.`, |
| 159 | + current version is ${process.versions.node}. Please upgrade.`, |
162 | 160 | ); |
163 | 161 | console.warn('Proceeding with execution id support disabled...'); |
164 | 162 | return false; |
|
0 commit comments