File tree Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -98,7 +98,7 @@ import type { WebviewViewProxy } from './webviews/webviewsController';
9898import { WebviewsController } from './webviews/webviewsController' ;
9999import { registerWelcomeWebviewPanel } from './webviews/welcome/registration' ;
100100
101- export type Environment = 'dev' | 'staging' | 'production' ;
101+ export type Environment = 'local' | ' dev' | 'staging' | 'production' ;
102102
103103export class Container {
104104 static #instance: Container | undefined ;
@@ -527,6 +527,7 @@ export class Container {
527527 get env ( ) : Environment {
528528 if ( this . prereleaseOrDebugging ) {
529529 const env = configuration . getAny ( 'gitkraken.env' ) ;
530+ if ( env === 'local' ) return 'local' ;
530531 if ( env === 'dev' ) return 'dev' ;
531532 if ( env === 'staging' ) return 'staging' ;
532533 }
@@ -927,6 +928,11 @@ export class Container {
927928 return Uri . parse ( 'https://dev.gitkraken.dev' ) ;
928929 }
929930
931+ if ( this . env === 'local' ) {
932+ const url : string | undefined = configuration . getAny ( 'gitkraken.url.gkdev.base' ) ;
933+ return Uri . parse ( url ?? 'http://localhost:3000' ) ;
934+ }
935+
930936 return Uri . parse ( 'https://gitkraken.dev' ) ;
931937 }
932938
Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ import { memoize } from '../../system/decorators/memoize';
2727import { Logger } from '../../system/logger' ;
2828import type { LogScope } from '../../system/logger.scope' ;
2929import { getLogScope } from '../../system/logger.scope' ;
30+ import { configuration } from '../../system/vscode/configuration' ;
3031
3132interface FetchOptions {
3233 cancellation ?: CancellationToken ;
@@ -55,6 +56,11 @@ export class ServerConnection implements Disposable {
5556 return Uri . parse ( 'https://devapi.gitkraken.com' ) ;
5657 }
5758
59+ if ( this . container . env === 'local' ) {
60+ const url : string | undefined = configuration . getAny ( 'gitkraken.url.api' ) ;
61+ return Uri . parse ( url ?? 'http://localhost:3000' ) ;
62+ }
63+
5864 return Uri . parse ( 'https://api.gitkraken.com' ) ;
5965 }
6066
@@ -72,6 +78,11 @@ export class ServerConnection implements Disposable {
7278 return Uri . parse ( 'https://dev-api.gitkraken.dev' ) ;
7379 }
7480
81+ if ( this . container . env === 'local' ) {
82+ const url : string | undefined = configuration . getAny ( 'gitkraken.url.gkdev.api' ) ;
83+ return Uri . parse ( url ?? 'http://localhost:3000' ) ;
84+ }
85+
7586 return Uri . parse ( 'https://api.gitkraken.dev' ) ;
7687 }
7788
You can’t perform that action at this time.
0 commit comments