1- import path from "path" ;
21import { Command } from "interactive-commander" ;
32import createOra from "ora" ;
43import { getSettings } from "../../utils/settings" ;
@@ -7,7 +6,6 @@ import { IIntegrationFlow } from "./flows/_base";
76import { PullRequestFlow } from "./flows/pull-request" ;
87import { InBranchFlow } from "./flows/in-branch" ;
98import { getPlatformKit } from "./platforms" ;
10- import { getConfig } from "../../utils/config" ;
119
1210interface CIOptions {
1311 parallel ?: boolean ;
@@ -72,53 +70,29 @@ export default new Command()
7270 parseBooleanArg ,
7371 )
7472 . action ( async ( options : CIOptions ) => {
75- const configDir = options . workingDirectory
76- ? path . resolve ( process . cwd ( ) , options . workingDirectory )
77- : process . cwd ( ) ;
78- const originalCwd = process . cwd ( ) ;
79- let config ;
80- try {
81- process . chdir ( configDir ) ;
82- config = getConfig ( false ) ;
83- } finally {
84- process . chdir ( originalCwd ) ;
85- }
86-
87- const isVNext = ! ! config ?. vNext ;
88-
8973 const settings = getSettings ( options . apiKey ) ;
9074
91- if ( isVNext ) {
92- if ( ! settings . auth . vnext ?. apiKey ) {
93- console . error (
94- "No LINGO_API_KEY provided. vNext requires LINGO_API_KEY environment variable." ,
95- ) ;
96- return ;
97- }
98- } else {
99- if ( ! settings . auth . apiKey ) {
100- console . error ( "No API key provided" ) ;
101- return ;
102- }
75+ if ( ! settings . auth . apiKey ) {
76+ console . error (
77+ "No API key provided. Set LINGO_API_KEY environment variable or use --api-key flag." ,
78+ ) ;
79+ return ;
80+ }
10381
104- const authenticator = createAuthenticator ( {
105- apiUrl : settings . auth . apiUrl ,
106- apiKey : settings . auth . apiKey ,
107- } ) ;
82+ const authenticator = createAuthenticator ( {
83+ apiUrl : settings . auth . apiUrl ,
84+ apiKey : settings . auth . apiKey ,
85+ } ) ;
10886
109- const auth = await authenticator . whoami ( ) ;
110- if ( ! auth ) {
111- console . error ( "Not authenticated" ) ;
112- return ;
113- }
87+ const auth = await authenticator . whoami ( ) ;
88+ if ( ! auth ) {
89+ console . error ( "Not authenticated" ) ;
90+ return ;
11491 }
11592
11693 const env = {
11794 ...( settings . auth . apiKey && {
118- LINGODOTDEV_API_KEY : settings . auth . apiKey ,
119- } ) ,
120- ...( settings . auth . vnext ?. apiKey && {
121- LINGO_API_KEY : settings . auth . vnext . apiKey ,
95+ LINGO_API_KEY : settings . auth . apiKey ,
12296 } ) ,
12397 LINGODOTDEV_PULL_REQUEST : options . pullRequest ?. toString ( ) || "false" ,
12498 ...( options . commitMessage && {
@@ -162,7 +136,7 @@ export default new Command()
162136 }
163137
164138 const hasChanges = await flow . run ( {
165- parallel : isVNext || options . parallel ,
139+ parallel : options . parallel ,
166140 } ) ;
167141 if ( ! hasChanges ) {
168142 return ;
0 commit comments