@@ -7,7 +7,7 @@ import { join, parse } from 'path'
77import { exit } from 'process'
88import { setCurlStore } from '../curl'
99import { pickStamp , printStamp } from '../service/stamp'
10- import { fileExists , isGateway , readStdin } from '../utils'
10+ import { fileExists , readStdin } from '../utils'
1111import { CommandLineError } from '../utils/error'
1212import { getMime } from '../utils/mime'
1313import { stampProperties } from '../utils/option'
@@ -127,7 +127,7 @@ export class Upload extends RootCommand implements LeafCommand {
127127 public async run ( usedFromOtherCommand = false ) : Promise < void > {
128128 super . init ( )
129129
130- if ( this . hasUnsupportedGatewayOptions ( ) ) {
130+ if ( await this . hasUnsupportedGatewayOptions ( ) ) {
131131 exit ( 1 )
132132 }
133133
@@ -145,7 +145,7 @@ export class Upload extends RootCommand implements LeafCommand {
145145 }
146146
147147 if ( ! this . stamp ) {
148- if ( isGateway ( this . beeApiUrl ) ) {
148+ if ( await this . bee . isGateway ( ) ) {
149149 this . stamp = '0' . repeat ( 64 )
150150 } else {
151151 this . stamp = await pickStamp ( this . bee , this . console )
@@ -183,7 +183,7 @@ export class Upload extends RootCommand implements LeafCommand {
183183 if ( ! usedFromOtherCommand ) {
184184 this . console . quiet ( this . result . getOrThrow ( ) . toHex ( ) )
185185
186- if ( ! isGateway ( this . beeApiUrl ) && ! this . quiet ) {
186+ if ( ! ( await this . bee . isGateway ( ) ) && ! this . quiet ) {
187187 printStamp ( await this . bee . getPostageBatch ( this . stamp ) , this . console , { shortenBatchId : true } )
188188 }
189189 }
@@ -419,8 +419,8 @@ export class Upload extends RootCommand implements LeafCommand {
419419 return size
420420 }
421421
422- private hasUnsupportedGatewayOptions ( ) : boolean {
423- if ( ! isGateway ( this . beeApiUrl ) ) {
422+ private async hasUnsupportedGatewayOptions ( ) : Promise < boolean > {
423+ if ( ! ( await this . bee . isGateway ( ) ) ) {
424424 return false
425425 }
426426
0 commit comments